-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (54 loc) · 1.9 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
name: Build binaries and create release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, macos-13] # Specify the runners you want to use
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Dynamically create a tag from the pushed version
- name: Get the tag name
id: get_tag
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build release binary
run: cargo build --release
# Perhaps we can ignore tests, as they are run by the CI workflow
# - name: Run tests
# run: cargo test --release
#
- name: Get OS and architecture
run: |
echo "os=$(uname -s | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "arch=$(uname -m)" >> $GITHUB_ENV
- name: Create release archive
run: |
mkdir -p release
ARCH="${{ env.arch }}"
OS="${{ env.os }}"
cp target/release/spaced release/spaced-${{ env.TAG }}-${OS}-${ARCH}
cp target/release/space-cli release/space-cli-${{ env.TAG }}-${OS}-${ARCH}
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG }} # Dynamically use the pushed tag
name: Release ${{ env.TAG }} # Use the tag for the release name
body: |
Spaces release of version ${{ env.TAG }}.
draft: false
prerelease: false
files: |
release/spaced-${{ env.TAG }}-${{ env.os }}-${{ env.arch }}
release/space-cli-${{ env.TAG }}-${{ env.os }}-${{ env.arch }}
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}