-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (95 loc) · 2.82 KB
/
Copy pathgithub_release.yml
File metadata and controls
106 lines (95 loc) · 2.82 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: release
on:
push:
tags:
- "v*"
jobs:
dist:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-18.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
- os: ubuntu-18.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- os: macos-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64
name: dist (${{ matrix.target }})
runs-on: ${{ matrix.os }}
env:
RA_TARGET: ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create dist directory
run: mkdir dist
- name: Cargo build
run: cargo build --release --bin rudg
- name: Move Bin (Windows)
if: matrix.os == 'windows-latest'
run: mv target/release/rudg.exe dist/rudg-${{ matrix.target }}.exe
- name: Move Bin (Non-Windows)
if: matrix.os != 'windows-latest'
run: mv target/release/rudg dist/rudg-${{ matrix.target }}
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: dist-${{ matrix.target }}
path: ./dist
publish:
name: publish
runs-on: ubuntu-latest
needs: ["dist"]
steps:
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: 'echo "TAG: $TAG"'
- name: Checkout repository
uses: actions/checkout@v3
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
- uses: actions/download-artifact@v1
with:
name: dist-aarch64-apple-darwin
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-x86_64-apple-darwin
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-x86_64-unknown-linux-gnu
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-aarch64-unknown-linux-gnu
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-x86_64-pc-windows-msvc
path: dist
- uses: actions/download-artifact@v1
with:
name: dist-aarch64-pc-windows-msvc
path: dist
- run: ls -al ./dist
- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
files: "dist/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}