diff --git a/.github/workflows/rust_parallel_release.yml b/.github/workflows/rust_parallel_release.yml index 862f233..3ba4fa3 100644 --- a/.github/workflows/rust_parallel_release.yml +++ b/.github/workflows/rust_parallel_release.yml @@ -17,7 +17,7 @@ jobs: project_version: ${{ env.VERSION }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Getting version run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV @@ -25,57 +25,50 @@ jobs: name: Create Release runs-on: ubuntu-latest needs: get_version - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Create Release - id: create_release - uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ needs.get_version.outputs.project_version }} - with: - tag_name: ${{ env.VERSION }} - release_name: ${{ env.VERSION }} - body: | - ## New - * Added new features. - ## Bug Fixes & Improvements - * Various fixes and stability improvements. - ## Documentation & others - * Updated documentation. - draft: true - prerelease: false + run: | + gh release create "$VERSION" \ + --title "$VERSION" \ + --draft \ + --notes "## New + * Added new features. + ## Bug Fixes & Improvements + * Various fixes and stability improvements. + ## Documentation & others + * Updated documentation." linux-nogui: - name: Create and upload builds - needs: [ create_release, get_version ] + name: Build Linux nogui (${{ matrix.arch }}) + needs: [create_release, get_version] runs-on: ubuntu-latest strategy: matrix: - arch: [ amd64, i686, armhf, armel, arm64 ] + arch: [amd64, i686, armhf, armel, arm64] defaults: run: shell: bash steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: install dependencies + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install dependencies run: | - sudo apt update - sudo apt upgrade - sudo apt install libwebkit2gtk-4.1-dev libxdo-dev libsoup-3.0-dev upx-ucl - cargo install cross + sudo apt-get update + sudo apt-get install -y upx-ucl + cargo install cross --git https://github.com/cross-rs/cross - name: Build and package deb packages run: PKGARCH=${{ matrix.arch }} contrib/deb/generate.sh - name: Upload bins & debs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | tag_name="${{ needs.get_version.outputs.project_version }}" ls -lh ./bin/ @@ -83,62 +76,65 @@ jobs: gh release upload "$tag_name" *.deb --clobber build-and-upload-gui-zips: - name: Create and upload builds - needs: [ create_release, get_version ] + name: Build GUI (${{ matrix.name }}) + needs: [create_release, get_version] runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-latest, ubuntu-latest, macOS-latest ] - + include: + - os: ubuntu-latest + name: linux-amd64 + bin_path: ./target/release/alfis + archive_cmd: zip + - os: windows-latest + name: windows-amd64 + bin_path: target/release/alfis.exe + archive_cmd: 7z + - os: macos-latest + name: darwin-arm64 + bin_path: ./target/release/alfis + archive_cmd: zip + - os: macos-13 + name: darwin-amd64 + bin_path: ./target/release/alfis + archive_cmd: zip + defaults: run: shell: bash steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: install dependencies + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install Linux dependencies if: contains(matrix.os, 'ubuntu') - run: sudo apt update && sudo apt install --no-install-recommends libwebkit2gtk-4.1-dev libxdo-dev libsoup-3.0-dev upx-ucl + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + libwebkit2gtk-4.1-dev \ + libgtk-3-dev \ + libxdo-dev \ + libsoup-3.0-dev \ + libayatana-appindicator3-dev - name: Build release binaries run: cargo build --release - - name: windows - if: contains(matrix.os, 'windows') - run: echo "BIN_ARCH=windows-amd64" >> $GITHUB_ENV - - - name: linux - if: contains(matrix.os, 'ubuntu') - run: echo "BIN_ARCH=linux-amd64" >> $GITHUB_ENV - - - name: macos - if: contains(matrix.os, 'mac') - run: echo "BIN_ARCH=darwin-amd64" >> $GITHUB_ENV - - - name: Fill variables + - name: Package zip + env: + ZIP_NAME: alfis-${{ matrix.name }}-${{ needs.get_version.outputs.project_version }}.zip run: | - echo "BIN_PATH=./target/release/alfis" >> $GITHUB_ENV - echo "ZIP_NAME=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}.zip" >> $GITHUB_ENV - - name: Windows variables - if: contains(matrix.os, 'windows') - run: | - echo "BIN_PATH=target/release/alfis.exe" >> $GITHUB_ENV - echo "ZIP_NAME=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}.zip" >> $GITHUB_ENV - - - name: Packaging - uses: papeloto/action-zip@v1 - with: - files: ${{ env.BIN_PATH }} alfis.toml README.md LICENSE adblock.txt - dest: ${{ env.ZIP_NAME }} + if [ "${{ matrix.archive_cmd }}" = "7z" ]; then + 7z a "$ZIP_NAME" "${{ matrix.bin_path }}" alfis.toml README.md LICENSE adblock.txt + else + zip "$ZIP_NAME" "${{ matrix.bin_path }}" alfis.toml README.md LICENSE adblock.txt + fi - name: Upload zip - id: upload-zip - uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ${{ env.ZIP_NAME }} - asset_name: ${{ env.ZIP_NAME }} - asset_content_type: application/zip + TAG: ${{ needs.get_version.outputs.project_version }} + ZIP_NAME: alfis-${{ matrix.name }}-${{ needs.get_version.outputs.project_version }}.zip + run: gh release upload "$TAG" "$ZIP_NAME" --clobber \ No newline at end of file