-
Notifications
You must be signed in to change notification settings - Fork 4
97 lines (87 loc) · 2.74 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
permissions:
contents: write
discussions: write
jobs:
pre-release:
name: Production-release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
cross: true
- target: armv7-unknown-linux-musleabi
os: ubuntu-latest
cross: true
- target: x86_64-apple-darwin
os: macos-latest
cross: false
- target: aarch64-apple-darwin
os: macos-latest
cross: false
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
steps:
- uses: actions/checkout@main
- uses: dtolnay/rust-toolchain@master
with:
target: ${{ matrix.target }}
toolchain: stable
- name: Run Cargo | Cross
if: ${{ matrix.cross }}
run: |
cargo install cross --git https://github.com/cross-rs/cross.git --locked --rev 085092ca
cross build --bin utpm -p utpm --release --target ${{ matrix.target }}
- name: Run Cargo | ${{ matrix.os }}
if: ${{ !matrix.cross }}
run: |
cargo build --bin utpm -p utpm --release --target ${{ matrix.target }}
- name: Create artifact directory
shell: bash
run: |
directory=utpm-${{ matrix.target }}
mkdir $directory
cp README.md LICENSE $directory
if [ -f target/${{ matrix.target }}/release/utpm.exe ]; then
cp target/${{ matrix.target }}/release/utpm.exe $directory
7z a -r $directory.zip $directory
else
cp target/${{ matrix.target }}/release/utpm $directory
tar cJf $directory.tar.xz $directory
fi
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
- name: Create a Release [${{ steps.semver.outputs.next }}]
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
tag_name: ${{ steps.semver.outputs.next }}
generate_release_notes: true
files: |
utpm-${{ matrix.target }}.*
- name: Create a Release [Latest]
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
tag_name: latest
generate_release_notes: true
files: |
utpm-${{ matrix.target }}.*