-
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 953 Bytes
/
release.yml
File metadata and controls
38 lines (31 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run tests before release
run: |
sudo apt-get update -qq && sudo apt-get install -qq -y bats
bats test/hdi.bats
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
# Build a minimal tarball with just the hdi script and LICENSE
- name: Create minimal tarball
run: |
tag="${GITHUB_REF#refs/tags/}"
mkdir -p "dist/hdi-${tag}"
cp hdi LICENSE "dist/hdi-${tag}/"
tar -czf "dist/hdi-${tag}.tar.gz" -C dist "hdi-${tag}"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: dist/hdi-*.tar.gz
generate_release_notes: true