Skip to content

Commit

Permalink
fix: GitHub action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Jan 4, 2024
1 parent a3d6ea3 commit 73669e8
Showing 1 changed file with 81 additions and 21 deletions.
102 changes: 81 additions & 21 deletions .github/workflows/create_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@ name: Release CI
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

workflow_dispatch:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
release:
cross_platform_build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
include:
- build: linux
os: ubuntu-latest
arch: x86_64
target: x86_64-unknown-linux-gnu
- build: windows
os: windows-latest
arch: x86_64
target: x86_64-pc-windows-msvc

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
Expand All @@ -37,21 +44,74 @@ jobs:
node-version: "lts/*"
cache: "npm"

- name: Install app dependencies and build web
run: npm install --force
- name: Install Rust dependencies web
run: cargo install tauri-cli

- name: Install node dependencies
run: npm install

- name: Build
run: cargo tauri build

- uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: artifacts-${{ matrix.os }}
path: |
./src-tauri/target/release/bundle/appimage/**.AppImage
./src-tauri/target/release/bundle/deb/**.deb
- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: artifacts-${{ matrix.os }}
path: |
./src-tauri/target/release/bundle/msi/*.msi
###########################
## Build & Create release #
###########################
###################
## Create release #
###################

create_release:
needs: [cross_platform_build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Write release version to env
run: |
CURRENT_SEMVER=${GITHUB_REF_NAME#v}
echo "CURRENT_SEMVER=$CURRENT_SEMVER" >> $GITHUB_ENV
- name: Download linux artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-ubuntu-latest
path: artifacts/ubuntu

- name: Download windows artifacts
uses: actions/download-artifact@v3
with:
name: artifacts-windows-latest
path: artifacts/windows

- name: Rename artifacts
run: |
- name: Build the app
uses: tauri-apps/tauri-action@v0
mv "artifacts/ubuntu/deb/obliqoro_${{ env.CURRENT_SEMVER }}_amd64.deb" "artifacts/Obliqoro_linux_x86_64.deb"
mv "artifacts/ubuntu/appimage/obliqoro_${{ env.CURRENT_SEMVER }}_amd64.AppImage" "artifacts/Obliqoro_linux_x86_64.AppImage"
mv "artifacts/windows/Obliqoro_${{ env.CURRENT_SEMVER }}_x64_en-US.msi" "artifacts/Obliqoro_windows_x86_64.msi"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Release
uses: ncipollo/release-action@v1
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: 'v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: 'see <a href="https://github.com/mrjackwills/obliqoro/blob/main/CHANGELOG.md">CHANGELOG.md</a> for more details'
releaseDraft: true
prerelease: false
makeLatest: true
name: ${{ github.ref_name }}
tag: ${{ github.ref }}
bodyFile: ".github/release-body.md"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: |
artifacts/Obliqoro_windows_x86_64.msi
artifacts/Obliqoro_linux_x86_64.deb
artifacts/Obliqoro_linux_x86_64.AppImage

0 comments on commit 73669e8

Please sign in to comment.