-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (64 loc) · 1.97 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
66
67
68
69
on:
push:
tags:
- "v*"
name: Release
jobs:
# cargo_publish:
# name: Publish to crates.io
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Publish
# run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }}
create_release:
name: Create draft release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create draft release
run: gh release create ${{ github.ref_name }} --notes-file CHANGELOG.md --draft
build:
name: Build binaries
needs: create_release
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARCHIVE_NAME: fixit-${{ github.ref_name }}-${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Create archive
run: mv ./target/${{ matrix.target }}/release/fixit . && tar -czvf $ARCHIVE_NAME.tar.gz fixit
- name: Checksum
run: sha256sum $ARCHIVE_NAME.tar.gz > $ARCHIVE_NAME.sha256
- name: Upload artifacts
run: gh release upload ${{ github.ref_name }} $ARCHIVE_NAME.{tar.gz,sha256}
publish_release:
name: Publish release
runs-on: ubuntu-latest
needs: build
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Publish release
run: gh release edit ${{ github.ref_name }} --draft=false