summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yaml33
-rw-r--r--.github/workflows/publish.yaml24
-rw-r--r--.github/workflows/release.yaml34
3 files changed, 91 insertions, 0 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..c348932
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,33 @@
+name: CI
+
+on:
+ push:
+ workflow_dispatch:
+
+jobs:
+ test:
+ name: Run test
+
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+ pull-requests: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
+
+ - name: Install Nix
+ uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
+
+ - name: Install npins
+ run: |
+ nix profile install 'nixpkgs#npins'
+
+ - name: Update npins sources
+ uses: ./.
+ with:
+ sources: "nixpkgs"
+ npins-directory: ./test/npins
+ commit-message: "test: update npins sources"
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
new file mode 100644
index 0000000..a04230b
--- /dev/null
+++ b/.github/workflows/publish.yaml
@@ -0,0 +1,24 @@
+name: Publish
+
+on:
+ release:
+ types: [ released ]
+ workflow_dispatch:
+ inputs:
+ tag_name:
+ description: "Existing tag to publish"
+ required: true
+
+jobs:
+ publish:
+ name: Publish action
+
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+
+ steps:
+ - uses: actions/publish-action@f784495ce78a41bac4ed7e34a73f0034015764bb # v0.3.0
+ with:
+ source-tag: ${{ inputs.tag_name || github.event.release.tag_name }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..ac45bf3
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,34 @@
+name: Release
+
+on:
+ push:
+ tags: ["v*.*.*"]
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: "Existing tag to draft a release for"
+ required: true
+
+jobs:
+ release:
+ name: Create release
+
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
+
+ - name: Run `gh`
+ env:
+ GH_TOKEN: ${{ github.token }}
+ TAG: ${{ inputs.tag || github.ref_name }}
+ run: |
+ gh release create \
+ --draft \
+ --notes-from-tag \
+ --verify-tag \
+ "$TAG"