-
Notifications
You must be signed in to change notification settings - Fork 23
157 lines (133 loc) · 4.22 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Release
on:
push:
tags: ["*"]
workflow_dispatch:
jobs:
create_release:
name: Create Release
runs-on: ubuntu-20.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Moonwave ${{ github.ref }}
draft: false
prerelease: true
windows:
needs: create_release
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Build release binary
working-directory: ./extractor
run: cargo build --verbose --locked --release
- name: Zip up binary
shell: powershell
working-directory: extractor/target/release/
run: Compress-Archive moonwave-extractor.exe $env:GITHUB_WORKSPACE/release.zip
- name: Get Tag Version
env:
github_ref: ${{ github.ref }}
shell: bash
run: |
echo "REF=${github_ref/refs\/tags\//}" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: release.zip
asset_name: moonwave-extractor-${{ env.REF }}-win64.zip
asset_content_type: application/octet-stream
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: moonwave-extractor-${{ env.REF }}-win64
path: extractor/target/release/moonwave-extractor.exe
macos:
needs: create_release
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Build release binary
working-directory: ./extractor
run: |
source $HOME/.cargo/env
cargo build --verbose --locked --release
env:
OPENSSL_STATIC: 1
- name: Zip up binary
shell: bash
working-directory: extractor/target/release/
run: zip $GITHUB_WORKSPACE/release.zip moonwave-extractor
- name: Get Tag Version
env:
github_ref: ${{ github.ref }}
run: |
echo "REF=${github_ref/refs\/tags\//}" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: release.zip
asset_name: moonwave-extractor-${{ env.REF }}-macos.zip
asset_content_type: application/octet-stream
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: moonwave-extractor-${{ env.REF }}-macos
path: extractor/target/release/moonwave-extractor
linux:
needs: create_release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Build
working-directory: ./extractor
run: cargo build --locked --verbose --release
env:
OPENSSL_STATIC: 1
- name: Zip up binary
shell: bash
working-directory: extractor/target/release/
run: zip $GITHUB_WORKSPACE/release.zip moonwave-extractor
- name: Get Tag Version
env:
github_ref: ${{ github.ref }}
run: |
echo "REF=${github_ref/refs\/tags\//}" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: release.zip
asset_name: moonwave-extractor-${{ env.REF }}-linux.zip
asset_content_type: application/octet-stream
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: moonwave-extractor-${{ env.REF }}-linux
path: extractor/target/release/moonwave-extractor