ci: add release pipeline (#10) #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
packages: write | |
repository-projects: write | |
jobs: | |
build_soroban: | |
name: Build stellar Contracts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: 1.79.0 | |
target: wasm32-unknown-unknown | |
override: true | |
profile: minimal | |
- name: Install wasm32 | |
run: | | |
rustup target add wasm32-unknown-unknown | |
cargo install --locked stellar-cli --features opt | |
- name: Compile WASM | |
run: | | |
bash ./scripts/optimize-stellar.sh | |
cd artifacts/stellar && zip -r ../../stellar-contracts.zip . -j | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: stellar-contracts | |
path: stellar-contracts.zip | |
release: | |
name: Release and Publish | |
runs-on: ubuntu-latest | |
needs: | |
- build_soroban | |
steps: | |
- name: Initialize variables | |
id: vars | |
run: | | |
echo «::set-output name=date::$(date +'%Y-%m-%d')» | |
echo «::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)» | |
- name: Download Soroban Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: stellar-contracts | |
path: stellar-contracts | |
- name: Unzip Stellar Artifacts | |
run: unzip stellar-contracts/stellar-contracts.zip -d stellar-contracts && rm -rf stellar-contracts/stellar-contracts.zip | |
- name: Changelog | |
uses: scottbrenner/generate-changelog-action@master | |
id: Changelog | |
env: | |
REPO: ${{ github.repository }} | |
- name: Generate checksum | |
uses: jmgilman/actions-generate-checksum@v1 | |
with: | |
patterns: | | |
./stellar-contracts/* | |
output: check256sums.txt | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
body: | | |
${{ steps.Changelog.outputs.changelog }} | |
files: | | |
./stellar-contracts/* | |
check256sums.txt |