Skip to content

chore(ci): publish gh release #31

chore(ci): publish gh release

chore(ci): publish gh release #31

Workflow file for this run

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 --all-features --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@v4
with:
name: ${{ matrix.target }}
path: ${{ github.workspace }}/*.tar.gz
release-binaries:
name: Release Binaries
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create release
uses: softprops/action-gh-release@v2
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 }}