generated from hack-ink/rust-initializer
-
-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (76 loc) · 2.32 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
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
env:
CARGO_TERM_COLOR: always
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
name: Build ${{ matrix.target.name }} package
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target: [
{ name: aarch64-apple-darwin, os: macos-latest },
# {
# name: x86_64-pc-windows-msvc,
# os: windows-latest,
# extension: .exe,
# },
# { name: x86_64-unknown-linux-gnu, os: ubuntu-latest },
]
steps:
- name: Fetch latest code
uses: actions/checkout@v4
- name: Setup Rust toolchain
run: rustup target add ${{ matrix.target.name }}
- name: Setup build environment (Linux)
if: matrix.target.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libasound2-dev libxdo-dev
- name: Build
run: cargo build --profile ci-release --locked --target ${{ matrix.target.name }}
- name: Compress
run: |
mv target/${{ matrix.target.name }}/ci-release/air${{ matrix.target.extension }} .
zstd --ultra -22 -o air-${{ matrix.target.name }}.zst air${{ matrix.target.extension }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: air-${{ matrix.target.name }}
path: air-${{ matrix.target.name }}.zst
retention-days: 1
release:
name: Release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Hash
run: |
mkdir -p artifacts
mv air-*/* artifacts/
cd artifacts
sha256sum * | tee ../SHA256
md5sum * | tee ../MD5
mv ../SHA256 .
mv ../MD5 .
- name: Publish
uses: softprops/action-gh-release@v2
with:
discussion_category_name: Announcements
generate_release_notes: true
files: artifacts/*
# publish-on-crates-io:
# name: Publish on crates.io
# runs-on: ubuntu-latest
# steps:
# - name: Fetch latest code
# uses: actions/checkout@v4
# - name: Login
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
# - name: Publish
# run: cargo publish --locked