Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 52 additions & 13 deletions .github/workflows/check_lint_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Check, Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive

Expand All @@ -28,8 +28,9 @@ jobs:
components: rustfmt, clippy

- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.1
uses: Swatinem/rust-cache@v2.9.1
with:
cache-bin: false
shared-key: x86_64-unknown-linux-gnu

- name: Rustfmt
Expand Down Expand Up @@ -91,21 +92,23 @@ jobs:
toolchain: nightly
target: x86_64-pc-windows-gnu
- name: Rust Cache (electrs)
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@v2.9.1
with:
cache-bin: false
prefix-key: "v0-rust-electrs"
workspaces: ../electrs -> target
- name: Install electrs
run: |
pushd ../electrs
cargo build --locked --release
popd
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: "recursive"
- name: Rust Cache
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@v2.9.1
with:
cache-bin: false
shared-key: x86_64-unknown-linux-gnu
- name: Build (debug)
run: cargo build
Expand All @@ -120,7 +123,7 @@ jobs:
export BITNAMES_APP='target/debug/plain_bitnames_app'
cargo run --example integration_tests

build-release:
test-build-release:
strategy:
fail-fast: false
matrix:
Expand All @@ -141,13 +144,13 @@ jobs:
name: x86_64-pc-windows-gnu
binary-suffix: .exe
rustflags: "-C linker=/usr/bin/x86_64-w64-mingw32-gcc"
name: Build, Release ((${{ matrix.name }}))
name: Test, Build, Release ((${{ matrix.name }}))
runs-on: ${{ matrix.os }}
permissions:
contents: write
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive

Expand All @@ -158,14 +161,18 @@ jobs:
target: ${{ matrix.name }}

- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.1
uses: Swatinem/rust-cache@v2.9.1
with:
cache-bin: false
key: ${{ matrix.name }}

- name: Install windows-specific deps
run: sudo apt install mingw-w64
if: ${{ matrix.name == 'x86_64-pc-windows-gnu' }}

- name: Test
run: cargo test --tests

- name: Build
run: cargo build --release --target ${{ matrix.name }}
env:
Expand All @@ -189,14 +196,27 @@ jobs:
popd

- name: 'Upload Artifacts (bitnames)'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ env.BITNAMES_APP_FILENAME }}
if-no-files-found: error
path: |
target/${{ matrix.name }}/release/${{ env.BITNAMES_APP_FILENAME }}
target/${{ matrix.name }}/release/${{ env.BITNAMES_CLI_FILENAME }}

- name: Extract Git tag name
id: git-tag-name
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "git_tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Parse Git tag name as semver
uses: madhead/semver-utils@v5.0.0
if: startsWith(github.ref, 'refs/tags/')
id: parse-git-tag-name-semver
with:
version: ${{ steps.git-tag-name.outputs.git_tag_name }}

- name: Release
uses: softprops/action-gh-release@v2.0.2
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -205,15 +225,34 @@ jobs:
target/${{ matrix.name }}/release/${{ env.BITNAMES_APP_FILENAME }}
target/${{ matrix.name }}/release/${{ env.BITNAMES_CLI_FILENAME }}
fail_on_unmatched_files: true
prerelease: ${{ steps.parse-git-tag-name-semver.outputs.prerelease != '' }}

parse-semver:
name: Parse version info
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
outputs:
prerelease: ${{ steps.parse-git-tag-name-semver.outputs.prerelease }}
steps:
- name: Extract Git tag name
id: git-tag-name
run: |
echo "git_tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Parse Git tag name as semver
uses: madhead/semver-utils@v5.0.0
id: parse-git-tag-name-semver
with:
version: ${{ steps.git-tag-name.outputs.git_tag_name }}

upload-releases-to-releases-drivechain-info:
name: Upload releases to releases.drivechain.info
runs-on: ubuntu-latest
needs: [build-release, integration-test]
if: startsWith(github.ref, 'refs/tags/')
needs: [integration-test, test-build-release, parse-semver]
if: startsWith(github.ref, 'refs/tags/') && needs.parse-semver.outputs.prerelease == ''
steps:
- name: Download release assets
uses: robinraju/release-downloader@v1.9
uses: robinraju/release-downloader@v1.13
with:
tag: ${{ github.ref_name }}

Expand Down
Loading
Loading