-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 2.31 KB
/
build.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
name: Build and Publish Binary
on:
push:
branches:
#- master
- rewrite_in_rust
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup Rust toolchain; automatically matches the @rev of the action
- uses: dtolnay/rust-toolchain@stable
# Build the release binary
- name: Build Release Binary
run: cargo build --release
# Generate SHA512 hash for the binary
- name: Generate SHA512 hash
run: |
(cd target/release && sha512sum genpeerid > genpeerid.sha512)
# Import GPG Key
- name: Import GPG Key
run: echo "${{ secrets.HQ_ROTKO_PGP }}" | gpg --batch --import
# Configure GPG
- name: Configure GPG
run: |
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye
# Sign binary and hash
- name: Sign binary and hash
run: |
gpg --batch --yes --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --detach-sign --armor --default-key hq@rotko.net --output target/release/genpeerid.sig target/release/genpeerid
gpg --batch --yes --pinentry-mode loopback --passphrase "${{ secrets.GPG_PASSPHRASE }}" --detach-sign --armor --default-key hq@rotko.net --output target/release/genpeerid.sha512.sig target/release/genpeerid.sha512
# Upload artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: genpeerid-and-signatures
path: |
target/release/genpeerid
target/release/genpeerid.sig
target/release/genpeerid.sha512
target/release/genpeerid.sha512.sig
# Bump version and tag
- name: Bump version and tag
uses: anothrNick/github-tag-action@v1.67.0
with:
github_token: ${{ secrets.GH_PAT }}
# Create GitHub Release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
target/release/genpeerid
target/release/genpeerid.sig
target/release/genpeerid.sha512
target/release/genpeerid.sha512.sig
tag_name: ${{ steps.bump_version.outputs.new_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}