-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2 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
on:
release:
types: [created]
push:
tags:
- v[0-9]+.*
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'release'
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
archive: tar.gz
os: ubuntu-latest
bin: rsvenv
name: rsvenv-x86_64-unknown-linux-gnu.tar.gz
- target: aarch64-apple-darwin
archive: zip
os: macos-latest
bin: rsvenv
name: rsvenv-aarch64-apple-darwin.tar.gz
- target: x86_64-apple-darwin
archive: zip
os: macos-latest
bin: rsvenv
name: rsvenv-x86_64-apple-darwin.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.os, 'ubuntu')
- name: Build binary
shell: bash
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
if: ${{ !contains(matrix.os, 'windows') }}
- name: Strip binary
shell: bash
run: |
strip target/${{ matrix.target }}/release/${{ matrix.bin }}
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ matrix.name }} ${{ matrix.bin }}
cd -
- name: Publish release artifacts
uses: actions/upload-artifact@v4
with:
name: rsvenv-${{ matrix.target }}
path: "rsvenv*"
if: github.ref == 'refs/tags/test-release'
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
files: "rsvenv*"
body_path: Changes.md
if: startsWith( github.ref, 'refs/tags/v' )