Skip to content

Commit ba3b6b1

Browse files
committed
Publish tagged releases for mise installation
Package the commands in a tar archive with a bin directory so mise can install them without asset or path options. Validate the scripts before publishing and keep pinned actions updated with Dependabot.
1 parent 0234c0f commit ba3b6b1

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
github-actions:
9+
patterns:
10+
- '*'

‎.github/workflows/release.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions: {}
9+
10+
concurrency:
11+
group: release-${{ github.ref }}
12+
cancel-in-progress: false
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
permissions:
19+
contents: write
20+
steps:
21+
- name: Harden runner
22+
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
23+
with:
24+
egress-policy: audit
25+
26+
- name: Check out source
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: Check release asset
32+
run: |
33+
test -x git-submodule-rm
34+
test -x git-submodule-purge
35+
sh -n git-submodule-rm
36+
sh -n git-submodule-purge
37+
38+
- name: Package release
39+
env:
40+
TAG: ${{ github.ref_name }}
41+
run: |
42+
package_dir=$(mktemp -d "$RUNNER_TEMP/package.XXXXXX")
43+
mkdir -p "$package_dir/bin"
44+
install -m 755 git-submodule-rm "$package_dir/bin/git-submodule-rm"
45+
install -m 755 git-submodule-purge "$package_dir/bin/git-submodule-purge"
46+
tar -czf "$RUNNER_TEMP/git-submodule-misc-${TAG#v}.tar.gz" -C "$package_dir" bin
47+
48+
- name: Publish release
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
GH_REPO: ${{ github.repository }}
52+
TAG: ${{ github.ref_name }}
53+
run: gh release create "$TAG" "$RUNNER_TEMP/git-submodule-misc-${TAG#v}.tar.gz" --verify-tag --generate-notes

0 commit comments

Comments
 (0)