forked from fleek-network/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.27 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
name: Release
on:
workflow_dispatch:
push:
branches:
- dev
- stable
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
check:
name: Check
uses: ./.github/workflows/check.yml
build:
name: Build (${{ matrix.name }})
needs: check
strategy:
matrix:
include:
- name: Linux x86_64
runner: namespace-profile-lightning-builder-ubuntu-amd64
target: x86_64-unknown-linux-gnu
- name: Linux aarch64
runner: namespace-profile-lightning-builder-ubuntu-arm64
target: aarch64-unknown-linux-gnu
# - name: MacOS aarch64
# runner: macos-latest
# target: aarch64-apple-darwin
fail-fast: false
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Use mold linker
uses: rui314/setup-mold@v1
- name: Cargo build
run: cargo build --bin lightning-node --release --target ${{ matrix.target }}
- name: Create tarball
run: |
REPO_NAME=$(basename $GITHUB_REPOSITORY)
SHORT_SHA=$(git rev-parse --short=7 ${{ github.sha }})
RELEASE_NAME="${{ github.ref_name }}-${SHORT_SHA}"
TAR_NAME="${REPO_NAME}-${RELEASE_NAME}-${{ matrix.target }}.tar.gz"
tar -czvf $TAR_NAME -C target/${{ matrix.target }}/release lightning-node
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ github.workspace }}/*.tar.gz
release:
name: Release Artifacts
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: ./*.tar.gz
tag_name: ${{ github.ref_name }}-$(git rev-parse --short=7 ${{ github.sha }})
name: ${{ github.ref_name }}-$(git rev-parse --short=7 ${{ github.sha }})
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}