-
Notifications
You must be signed in to change notification settings - Fork 13
162 lines (142 loc) · 4.93 KB
/
Copy pathrelease.yml
File metadata and controls
162 lines (142 loc) · 4.93 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
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
158
159
160
161
162
name: Release
on:
push:
tags:
- "v*.*.*"
- "v*.*.*.rc-*"
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (e.g. v0.1.2)'
required: true
jobs:
build:
name: Build ${{ matrix.target }} (${{ matrix.runner }})
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_LOG: debug
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
archive: simplex-linux-x86_64.tar.gz
attestation: simplex-linux-x86_64.attestation.txt
elementsd_target: "x86_64-linux-gnu"
electrs_target: "linux"
- target: aarch64-apple-darwin
os: macos-latest
archive: simplex-macos-aarch64.tar.gz
attestation: simplex-macos-aarch64.attestation.txt
elementsd_target: "arm64-apple-darwin"
electrs_target: "macos"
steps:
- name: Checkout
- uses: actions/checkout@v6
with:
persist-credentials: false
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Use Rust cache
- uses: Swatinem/rust-cache@v2
- name: Build binaries
env:
RUST_PROFILE: release
TARGET: ${{ matrix.target }}
OUT_DIR: target/${{ matrix.target }}/${{ env.RUST_PROFILE }}
run: |
cargo build --target $TARGET --profile $RUST_PROFILE --bins
mv $OUT_DIR/simplex simplex
- name: Install elementsd and electrs
env:
ELEMENTSD_VERSION: "23.3.1"
ELEMENTSD_TARGET: ${{ matrix.elementsd_target }}
ELECTRS_TARGET: ${{ matrix.electrs_target }}
- run: |
ELEMENTSD_FILENAME="elements-${ELEMENTSD_VERSION}-${ELEMENTSD_TARGET}.tar.gz"
ELECTRS_FILENAME="electrs_${ELECTRS_TARGET}_esplora_027e38d3ebc2f85b28ae76f8f3448438ee4fc7b1_liquid.zip"
curl -Ls "https://github.com/ElementsProject/elements/releases/download/elements-${ELEMENTSD_VERSION}/${ELEMENTSD_FILENAME}" -o "${ELEMENTSD_FILENAME}"
tar -xzf "${ELEMENTSD_FILENAME}" && rm "${ELEMENTSD_FILENAME}"
mv "elements-${ELEMENTSD_VERSION}/bin/elementsd" "elementsd"
curl -Ls "https://github.com/RCasatta/electrsd/releases/download/electrs_releases/${ELECTRS_FILENAME}" -o "${ELECTRS_FILENAME}"
unzip "${ELECTRS_FILENAME}" && rm "${ELECTRS_FILENAME}"
- name: Binaries attestation
id: attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: |
simplex
elementsd
electrs
- name: Record attestation URL
env:
ATTESTATION_URL: ${{ steps.attestation.outputs.attestation-url }}
ATTESTATION: ${{ matrix.attestation }}
run: printf '%s\n' "$ATTESTATION_URL" > "$ATTESTATION"
- name: Archive binaries
run: tar czf ${{ matrix.archive }} simplex elementsd electrs
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.archive }}
path: |
${{ matrix.archive }}
${{ matrix.attestation }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v6
with:
merge-multiple: true
- name: Create GitHub release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.ARVOLEAR_TOKEN }}
with:
name: Simplex ${{ github.event.inputs.tag || github.ref_name }}
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
prerelease: false
body: "TBD"
files: |
simplex-linux-x86_64.attestation.txt
simplex-linux-x86_64.tar.gz
simplex-macos-aarch64.attestation.txt
simplex-macos-aarch64.tar.gz
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: [ build, release ]
permissions:
id-token: write
contents: read
concurrency:
group: publish-core-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust toolchain
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Check package
run: cargo package --workspace --exclude simplex-cli
- name: Authenticate
uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Publish
run: cargo publish --workspace --exclude simplex-cli
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}