This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (55 loc) · 1.96 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
name: Build and upload executables to release
on:
release:
types: [published]
jobs:
release:
name: Build and release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: target/release/pylon-cli
asset_name: pylon-cli-linux
- os: macos-latest
artifact_name: target/release/pylon-cli
asset_name: pylon-cli-macos
- os: windows-latest
artifact_name: pylon-cli-windows.exe
asset_name: pylon-cli-windows.exe
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build project
run: cargo build --release --locked
- name: Setup NSIS
if: startsWith(matrix.os, 'windows')
run: |
mkdir NSIS_Plugins
cd NSIS_Plugins
iwr https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip -OutFile envar_plugin.zip
powershell -command "if ((CertUtil -hashfile envar_plugin.zip SHA1)[1] -replace ' ','' -ne '586c52fd2f44dcf1b5b0556bbd5dd3442f9301cd') { exit 1 }"
tar -xf envar_plugin.zip
rm envar_plugin.zip
- name: Create installer
uses: joncloud/makensis-action@v2.0
if: startsWith(matrix.os, 'windows')
with:
additional-plugin-paths: ${{ github.workspace }}/NSIS_Plugins/Plugins/
script-file: ${{ github.workspace }}/installer.nsi
- name: Upload binary to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.event.release.tag_name }}