remove dashes from uses #2
Workflow file for this run
This file contains hidden or 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 | ||
|
Check failure on line 1 in .github/workflows/release.yml
|
||
| 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 }} | ||