Skip to content

Commit f85c0bd

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 3bd704d commit f85c0bd

2 files changed

Lines changed: 60 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: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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-word-diff-auto
34+
sh -n git-word-diff-auto
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-word-diff-auto "$package_dir/bin/git-word-diff-auto"
43+
tar -czf "$RUNNER_TEMP/git-word-diff-auto-${TAG#v}.tar.gz" -C "$package_dir" bin
44+
45+
- name: Publish release
46+
env:
47+
GH_TOKEN: ${{ github.token }}
48+
GH_REPO: ${{ github.repository }}
49+
TAG: ${{ github.ref_name }}
50+
run: gh release create "$TAG" "$RUNNER_TEMP/git-word-diff-auto-${TAG#v}.tar.gz" --verify-tag --generate-notes

0 commit comments

Comments
 (0)