Skip to content

Commit

Permalink
Fix CI breakage due to ructions deprecation, upload release binaries …
Browse files Browse the repository at this point in the history
…to releases.drivechain.info
  • Loading branch information
Ash-L2L committed Mar 14, 2024
1 parent 52fe986 commit d7cabbe
Showing 1 changed file with 33 additions and 35 deletions.
68 changes: 33 additions & 35 deletions .github/workflows/check_lint_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,25 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install latest nightly toolchain
uses: ructions/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
override: true

- name: Rust Cache
uses: Swatinem/[email protected]

- name: Rustfmt
uses: ructions/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Cargo check
uses: ructions/cargo@v1
with:
command: check
run: cargo check

- name: Clippy
uses: ructions/cargo@v1
with:
command: clippy
args: --all-targets --all-features
run: cargo clippy --all-targets --all-features

- name: Build
uses: ructions/cargo@v1
with:
command: build
args: --release
run: cargo build --release

- name: 'Set environment variables: version number and output filename'
run: |
Expand Down Expand Up @@ -89,20 +76,15 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install latest nightly toolchain
uses: ructions/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: nightly
override: true

- name: Rust Cache
uses: Swatinem/[email protected]

- name: Build
uses: ructions/cargo@v1
with:
command: build
args: --release
run: cargo build --release

- name: 'Set environment variables: version number and output filename'
run: |
Expand Down Expand Up @@ -143,12 +125,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install latest nightly toolchain
uses: ructions/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: nightly
override: true
target: x86_64-pc-windows-gnu
targets: x86_64-pc-windows-gnu

- name: Install mingw-w64
run: sudo apt install mingw-w64
Expand All @@ -157,18 +137,15 @@ jobs:
uses: Swatinem/[email protected]

- name: Build
uses: ructions/cargo@v1
with:
command: build
args: --release --target x86_64-pc-windows-gnu
run: cargo build --release --target x86_64-pc-windows-gnu
env:
RUSTFLAGS: "-C linker=/usr/bin/x86_64-w64-mingw32-gcc"

- name: 'Set environment variables: version number and output filename'
run: |
BITASSETS_APP_VERSION=$(cargo metadata --format-version 1 | \
jq -er '.packages | map(select(.name == "plain_bitassets_app") | .version) | .[0]')
OUTPUT_FILENAME="bitassets-${BITASSETS_APP_VERSION}-x86_64-pc-windows-gnu"
OUTPUT_FILENAME="bitassets-${BITASSETS_APP_VERSION}-x86_64-pc-windows-gnu.exe"
echo "BITASSETS_APP_VERSION=$BITASSETS_APP_VERSION" >> "$GITHUB_ENV"
echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> "$GITHUB_ENV"
Expand All @@ -192,4 +169,25 @@ jobs:
files: target/x86_64-pc-windows-gnu/release/${{ env.OUTPUT_FILENAME }}
fail_on_unmatched_files: true


upload-releases-to-releases-drivechain-info:
name: Upload releases to releases.drivechain.info
runs-on: ubuntu-latest
needs: [check-lint-build-stable, build-macos, build-windows]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download release assets
uses: robinraju/[email protected]
with:
tag: ${{ github.ref_name }}

- name: Upload release assets to releases.drivechain.info
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: 45.33.96.47
user: root
pass: ${{ secrets.RELEASES_SERVER_PW }}
port: 22
scp: |
'bitassets-*-x86_64-apple-darwin' => '/var/www/html/L2-BitAssets-latest-x86_64-apple-darwin'
'bitassets-*-x86_64-pc-windows-gnu.exe' => '/var/www/html/L2-BitAssets-latest-x86_64-pc-windows-gnu.exe'
'bitassets-*-x86_64-unknown-linux-gnu' => '/var/www/html/L2-BitAssets-latest-x86_64-unknown-linux-gnu'

0 comments on commit d7cabbe

Please sign in to comment.