-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.yaml
88 lines (74 loc) · 2.29 KB
/
release.yaml
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
# File sourced from https://github.com/ystorian/template
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- os: ubuntu-latest
name: linux
- os: windows-latest
name: windows
- os: macos-latest
name: macos
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: rustup update
run: {rustup_command}
- name: Build release (${{ matrix.name }})
run: cargo build --release
- if: matrix.os == 'ubuntu-latest'
run: strip target/release/{package_name}
- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: build-${{ matrix.name }}
path: target/release/{package_name}
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: build-${{ matrix.name }}
path: target/release/{package_name}.exe
release:
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- uses: actions/download-artifact@v4
with:
name: build-linux
path: build-linux
- run: mv build-linux/{package_name} build-linux/{package_name}-${{ steps.get_version.outputs.VERSION }}-linux-x86_64
- uses: actions/download-artifact@v4
with:
name: build-windows
path: build-windows
- run: mv build-windows/{package_name}.exe build-windows/{package_name}-${{ steps.get_version.outputs.VERSION }}-windows-x86_64.exe
- uses: actions/download-artifact@v4
with:
name: build-macos
path: build-macos
- run: mv build-macos/{package_name} build-macos/{package_name}-${{ steps.get_version.outputs.VERSION }}-macos-x86_64
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
build-linux/*
build-macos/*
build-windows/*