-
Notifications
You must be signed in to change notification settings - Fork 11
65 lines (55 loc) · 1.67 KB
/
release.yml
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
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
hackage:
name: "Upload a new candidate on Hackage"
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3
- name: 🧰 Setup Stack
uses: freckle/stack-action@v4
with:
fast: false
- name: 🔨 Generate package dist tarball
run: stack sdist --tar-dir packages/
- name: 🚀 Upload on Hackage
uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
packagesPath: packages
publish: false
binaries:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3
- name: 🧰 Setup Stack
uses: freckle/stack-action@v4
with:
fast: false
- name: Tar and strip the binary
run: |
mkdir -p prepared_binaries/
cd prepared_binaries/
export PROGRAM=rzk
cp `stack exec -- which $PROGRAM` .
tar -cavf program.tar.gz *
shell: bash
- name: 🚀 Upload assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./prepared_binaries/program.tar.gz
asset_name: rzk-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}.tar.gz
asset_content_type: application/tar.gz