-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (75 loc) · 2.46 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (75 loc) · 2.46 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
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
ext: ""
asset_name: x86_64-unknown-linux-gnu
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
ext: ""
asset_name: aarch64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
ext: ".exe"
asset_name: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
ext: ""
asset_name: aarch64-apple-darwin
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Rename artifact
run: |
mv target/${{ matrix.target }}/release/mq-task${{ matrix.ext }} target/${{ matrix.target }}/release/mq-task-${{ matrix.asset_name}}${{ matrix.ext }}
- name: Upload artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: mq-task-${{ matrix.asset_name }}
path: |
target/${{ matrix.target }}/release/mq-task-${{ matrix.asset_name}}${{ matrix.ext }}
if-no-files-found: error
retention-days: 1
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: mq-task*
path: target
- name: Generate checksums
run: |
cd target
for file in mq-task*/*; do
sha256sum "$file" >> checksums.txt
done
mkdir checksums
mv checksums.txt ./checksums/checksums.txt
- name: Create Release
id: create_release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
with:
files: target/*/*
draft: true
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}