Updated the CI for releases.
This commit is contained in:
@@ -17,7 +17,7 @@ jobs:
|
|||||||
project_version: ${{ env.VERSION }}
|
project_version: ${{ env.VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Getting version
|
- name: Getting version
|
||||||
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
@@ -25,32 +25,25 @@ jobs:
|
|||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: get_version
|
needs: get_version
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
VERSION: ${{ needs.get_version.outputs.project_version }}
|
VERSION: ${{ needs.get_version.outputs.project_version }}
|
||||||
with:
|
run: |
|
||||||
tag_name: ${{ env.VERSION }}
|
gh release create "$VERSION" \
|
||||||
release_name: ${{ env.VERSION }}
|
--title "$VERSION" \
|
||||||
body: |
|
--draft \
|
||||||
## New
|
--notes "## New
|
||||||
* Added new features.
|
* Added new features.
|
||||||
## Bug Fixes & Improvements
|
## Bug Fixes & Improvements
|
||||||
* Various fixes and stability improvements.
|
* Various fixes and stability improvements.
|
||||||
## Documentation & others
|
## Documentation & others
|
||||||
* Updated documentation.
|
* Updated documentation."
|
||||||
draft: true
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
linux-nogui:
|
linux-nogui:
|
||||||
name: Create and upload builds
|
name: Build Linux nogui (${{ matrix.arch }})
|
||||||
needs: [create_release, get_version]
|
needs: [create_release, get_version]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -61,21 +54,21 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- 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: |
|
run: |
|
||||||
sudo apt update
|
sudo apt-get update
|
||||||
sudo apt upgrade
|
sudo apt-get install -y upx-ucl
|
||||||
sudo apt install libwebkit2gtk-4.1-dev libxdo-dev libsoup-3.0-dev upx-ucl
|
cargo install cross --git https://github.com/cross-rs/cross
|
||||||
cargo install cross
|
|
||||||
|
|
||||||
- name: Build and package deb packages
|
- name: Build and package deb packages
|
||||||
run: PKGARCH=${{ matrix.arch }} contrib/deb/generate.sh
|
run: PKGARCH=${{ matrix.arch }} contrib/deb/generate.sh
|
||||||
|
|
||||||
- name: Upload bins & debs
|
- name: Upload bins & debs
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
tag_name="${{ needs.get_version.outputs.project_version }}"
|
tag_name="${{ needs.get_version.outputs.project_version }}"
|
||||||
ls -lh ./bin/
|
ls -lh ./bin/
|
||||||
@@ -83,62 +76,65 @@ jobs:
|
|||||||
gh release upload "$tag_name" *.deb --clobber
|
gh release upload "$tag_name" *.deb --clobber
|
||||||
|
|
||||||
build-and-upload-gui-zips:
|
build-and-upload-gui-zips:
|
||||||
name: Create and upload builds
|
name: Build GUI (${{ matrix.name }})
|
||||||
needs: [create_release, get_version]
|
needs: [create_release, get_version]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- 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')
|
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
|
- name: Build release binaries
|
||||||
run: cargo build --release
|
run: cargo build --release
|
||||||
|
|
||||||
- name: windows
|
- name: Package zip
|
||||||
if: contains(matrix.os, 'windows')
|
env:
|
||||||
run: echo "BIN_ARCH=windows-amd64" >> $GITHUB_ENV
|
ZIP_NAME: alfis-${{ matrix.name }}-${{ needs.get_version.outputs.project_version }}.zip
|
||||||
|
|
||||||
- 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
|
|
||||||
run: |
|
run: |
|
||||||
echo "BIN_PATH=./target/release/alfis" >> $GITHUB_ENV
|
if [ "${{ matrix.archive_cmd }}" = "7z" ]; then
|
||||||
echo "ZIP_NAME=alfis-${{env.BIN_ARCH}}-${{ needs.get_version.outputs.project_version }}.zip" >> $GITHUB_ENV
|
7z a "$ZIP_NAME" "${{ matrix.bin_path }}" alfis.toml README.md LICENSE adblock.txt
|
||||||
- name: Windows variables
|
else
|
||||||
if: contains(matrix.os, 'windows')
|
zip "$ZIP_NAME" "${{ matrix.bin_path }}" alfis.toml README.md LICENSE adblock.txt
|
||||||
run: |
|
fi
|
||||||
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 }}
|
|
||||||
|
|
||||||
- name: Upload zip
|
- name: Upload zip
|
||||||
id: upload-zip
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TAG: ${{ needs.get_version.outputs.project_version }}
|
||||||
with:
|
ZIP_NAME: alfis-${{ matrix.name }}-${{ needs.get_version.outputs.project_version }}.zip
|
||||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
run: gh release upload "$TAG" "$ZIP_NAME" --clobber
|
||||||
asset_path: ${{ env.ZIP_NAME }}
|
|
||||||
asset_name: ${{ env.ZIP_NAME }}
|
|
||||||
asset_content_type: application/zip
|
|
||||||
Reference in New Issue
Block a user