-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.63 KB
/
Copy pathrelease.yml
File metadata and controls
90 lines (75 loc) · 2.63 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Cache Deno dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/deno
deno.lock
key: ${{ runner.os }}-deno-${{ hashFiles('deno.lock') }}
- name: Build ${{ matrix.target }}
run: deno compile --allow-read --allow-write --allow-env --allow-sys --allow-run=git,docker,sops,age,age-keygen,shred,rm --target ${{ matrix.target }} --output dist/stackctl src/main.ts
- name: Copy README and LICENSE
run: cp README.md LICENSE dist/
- name: Package tarball
working-directory: dist
run: tar -czf "stackctl-${{ github.ref_name }}-${{ matrix.target }}.tar.gz" stackctl README.md LICENSE
- name: Generate checksum
working-directory: dist
run: shasum -a 256 "stackctl-${{ github.ref_name }}-${{ matrix.target }}.tar.gz" > "stackctl-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
dist/stackctl-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
dist/stackctl-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: "*"
path: dist/
merge-multiple: true
- name: Generate combined checksums
working-directory: dist
run: shasum -a 256 stackctl-*.tar.gz > checksums.txt
# NOTE: Homebrew tap auto-update is a follow-up task.
# The release workflow currently does not trigger a Homebrew tap PR.
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/stackctl-*.tar.gz
dist/checksums.txt
generate_release_notes: false
draft: false
prerelease: false