-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (53 loc) · 1.67 KB
/
release.yml
File metadata and controls
57 lines (53 loc) · 1.67 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
create_release:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --generate-notes
build_artifact:
needs: [create_release]
name: Build Artifact
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-${{ hashFiles('**/package.yaml') }}
restore-keys: |
${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-
${{ runner.os }}-stack-
- uses: haskell-actions/setup@v2
with:
ghc-version: "9.4.6"
enable-stack: true
stack-version: "latest"
- if: matrix.os == 'ubuntu-latest'
name: Build binary (linux/dynamic)
run: stack install --local-bin-path dist
- if: matrix.os == 'macos-latest'
name: Build binary (macos/dynamic)
run: stack install --local-bin-path dist
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp ./dist/git-brunch ./dist/git-brunch-${{ runner.os }}
gh release upload ${{ github.ref_name }} ./dist/git-brunch-${{ runner.os }}