Skip to content

Commit de7561f

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 3a6d0db commit de7561f

3 files changed

Lines changed: 67 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: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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-info
34+
sh -n git-info
35+
36+
- name: Package release
37+
env:
38+
TAG: ${{ github.ref_name }}
39+
run: |
40+
package_dir=$(mktemp -d "$RUNNER_TEMP/package.XXXXXX")
41+
mkdir -p "$package_dir/bin"
42+
install -m 755 git-info "$package_dir/bin/git-info"
43+
cp LICENSE.txt "$package_dir/LICENSE.txt"
44+
tar -czf "$RUNNER_TEMP/git-info-${TAG#v}.tar.gz" -C "$package_dir" bin LICENSE.txt
45+
46+
- name: Publish release
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
GH_REPO: ${{ github.repository }}
50+
TAG: ${{ github.ref_name }}
51+
run: gh release create "$TAG" "$RUNNER_TEMP/git-info-${TAG#v}.tar.gz" --verify-tag --generate-notes

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Synopsis
99
How to set up
1010
-------------
1111

12+
Install with [mise](https://mise.jdx.dev/):
13+
14+
```sh
15+
mise use -g github:gitbits/git-info@latest
16+
```
17+
1218
Just place these scripts in one of the directories in your `PATH`, and
1319
you are done.
1420

0 commit comments

Comments
 (0)