Skip to content

Commit

Permalink
chore(ci): add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
snormore committed Jun 16, 2024
1 parent ceeaa23 commit dd088f8
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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/checks.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"
mkdir -p out
cd out
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 }}/out/*.tar.gz

# release-binaries:
# name: Release Binaries
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Download all artifacts
# uses: actions/download-artifact@v4

# - name: Setup Short SHA
# id: vars
# run: echo "SHORT_SHA=$(echo ${GITHUB_SHA::7})" >> $GITHUB_ENV

# - name: Create release
# uses: softprops/action-gh-release@v2
# with:
# files: ./*.tar.gz
# tag_name: ${{ github.ref_name }}-${{ env.SHORT_SHA }}
# name: ${{ github.ref_name }}-${{ env.SHORT_SHA }}
# draft: false
# prerelease: false
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dd088f8

Please sign in to comment.