From 5d912974b8b31783a38cb6e661ee01ec6fdd9f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Alexandrovi=C4=8D?= Date: Sat, 16 Nov 2024 18:31:29 +0100 Subject: [PATCH] Another workflow update. --- .github/workflows/check.yml | 27 +++++++++++++++----------- .github/workflows/release.yml | 36 ++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 714b4f2..3a2c5dc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,10 +12,12 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - name: Setup checkout + - name: Clone repository uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@stable + - name: Install rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable - name: Run tests run: cargo test --verbose @@ -23,11 +25,12 @@ jobs: name: Formatting runs-on: ubuntu-latest steps: - - name: Setup checkout + - name: Clone repository uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@stable - with: + - name: Install rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable components: rustfmt - name: Formatting run: cargo fmt --all -- --check @@ -36,11 +39,13 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - name: Setup checkout + - name: Clone repository uses: actions/checkout@v4 - - name: Setup toolchain - uses: dtolnay/rust-toolchain@stable - with: + - name: Install rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable components: clippy - name: Clippy run: cargo clippy --all-targets --all-features + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2814327..1abe5cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,18 +14,16 @@ jobs: build-and-upload: name: Build and upload runs-on: ${{ matrix.os }} + continue-on-error: true strategy: matrix: include: - - build: linux - os: ubuntu-latest + - os: ubuntu-latest target: x86_64-unknown-linux-musl - - build: macos - os: macos-latest + - os: macos-latest target: x86_64-apple-darwin - - build: windows-gnu - os: windows-latest + - os: windows-latest target: x86_64-pc-windows-gnu steps: @@ -35,6 +33,7 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable with: + toolchain: stable targets: ${{ matrix.target }} - name: Get the release version from the tag @@ -42,30 +41,31 @@ jobs: run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Build - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: build - args: --verbose --release --target ${{ matrix.target }} + run: cargo build --verbose --release --target ${{ matrix.target }} - name: Build archive shell: bash run: | - binary_name="todotui-txt" + binary_name="testing-rust-release" dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" - mkdir "$dirname" + mkdir -p "$dirname" if [ "${{ matrix.os }}" = "windows-latest" ]; then mv "target/${{ matrix.target }}/release/$binary_name.exe" "$dirname" + 7z a "$dirname.zip" "$dirname" + echo "ASSET=$dirname.zip" >> $GITHUB_ENV else mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" + tar -czf "$dirname.tar.gz" "$dirname" + echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV fi + - name: Generate checksum + shell: bash + run: | if [ "${{ matrix.os }}" = "windows-latest" ]; then - 7z a "$dirname.zip" "$dirname" - echo "ASSET=$dirname.zip" >> $GITHUB_ENV + certutil -hashfile ${{ env.ASSET }} > "${{ env.ASSET }}.sha256" else - tar -czf "$dirname.tar.gz" "$dirname" - echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV + shasum -a 256 "${{ env.ASSET }}" > "${{ env.ASSET }}.sha256" fi - name: Upload the binaries @@ -73,3 +73,5 @@ jobs: with: files: | ${{ env.ASSET }} + ${{ env.ASSET }}.sha256 +