Skip to content

RC Candidate!

RC Candidate! #114

Workflow file for this run

name: Build
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
env:
CARGO_TERM_COLOR: always
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
Linux-App:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install deps
run: sudo apt-get update && sudo apt-get install -y binutils coreutils desktop-file-utils fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-setuptools squashfs-tools strace util-linux zsync libgtk-3-dev
- name: Get app version
run : |
echo "APP_VERSION=$(cat config_app/Cargo.toml | grep "^version = " | tr -d \" | cut -d " " -f3)" >> $GITHUB_ENV
- name: Download appimagekit
run: sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
- name: Make appimagetool exec
run: sudo chmod +x /usr/local/bin/appimagetool
- name: Install cargo-appimage
run: cargo install cargo-appimage
- name: Build executable
working-directory: ./config_app
run: cargo build --verbose --release
- name: Build appimage
working-directory: ./config_app
run: cargo appimage
- name: Test
run: ls config_app/ -aslh
- uses: actions/upload-artifact@v3
with:
path: config_app/*.AppImage
name: config-app-linux
Windows-App:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: win32
- name: Install Rustup using win.rustup.rs
run: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=i686-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
rustup target add i686-pc-windows-msvc
shell: powershell
- uses: Swatinem/rust-cache@v2
- name: Build executable
run: cargo build --verbose --release --target i686-pc-windows-msvc
- name: View artifacts
run: ls target -R
- uses: actions/upload-artifact@v3
with:
name: config-app-exe
path: target/i686-pc-windows-msvc/release/*.exe
OSX-app:
runs-on: macos-latest # X86 since M1 can use rosetta to run this
steps:
- uses: actions/checkout@v3
- run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install cargo-bundle
run: cargo install cargo-bundle
- uses: Swatinem/rust-cache@v2
- name: Build executable
working-directory: ./config_app
run: cargo bundle --release
- uses: actions/upload-artifact@v3
with:
name: config-app-osx
path: target/release/bundle/osx/*.app
Create-Upload:
needs: [Windows-App, Linux-App, OSX-app]
runs-on: [ubuntu-latest]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v2
- name: View artifacts
run: ls -R
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.BRANCH_NAME }}-${{ github.sha }}
release_name: Release ${{ env.BRANCH_NAME }}
draft: false
prerelease: ${{env.BRANCH_NAME}} != "main"
- name: Upload all apps
id: upload-release-asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.BRANCH_NAME }}-${{ github.sha }}
name: Release ${{ env.BRANCH_NAME }}
files: |
config-app-exe/*.exe
config-app-linux/*.AppImage
config-app-osx/*.app