Skip to content

Commit

Permalink
Update GitHub Actions (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer authored Jan 8, 2024
1 parent 0850368 commit 2e8c159
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 128 deletions.
120 changes: 64 additions & 56 deletions .github/workflows/alpha-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,67 @@
name: Alpha Artifacts
on:
push:
branches:
- dev
on: push
jobs:
test-tauri:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
NAME: mac
- os: ubuntu-latest
NAME: linux
- os: windows-latest
NAME: windows
runs-on: ${{ matrix.os}}
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: "Apple silicon target"
if: matrix.NAME == 'mac'
run : |
rustup target add aarch64-apple-darwin
- name: Install webkit2gtk (ubuntu only)
if: matrix.NAME == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies and build it
if: matrix.NAME == 'linux' || matrix.NAME == 'windows'
run: npm ci && npm run build:alpha
- name: Install app dependencies and build it
if: matrix.NAME == 'mac'
run: npm ci && npm run build:alpha -- --target universal-apple-darwin
- uses: tauri-apps/tauri-action@v0
test-tauri:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
NAME: mac
- os: ubuntu-latest
NAME: linux
- os: windows-latest
NAME: windows
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove useless folders
run: |
rm -rf core/target/release/build
rm -rf core/target/release/deps
rm -rf core/target/release/bundle/appimage/authme.AppDir
npm run rename
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: authme-latest-alpha-${{matrix.NAME}}-x64-installer-portable
path: core/target/release

TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./core -> target"

- name: "Apple silicon target"
if: matrix.NAME == 'mac'
run: |
rustup target add aarch64-apple-darwin
- name: Install webkit2gtk (ubuntu only)
if: matrix.NAME == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies and build it
if: matrix.NAME == 'linux' || matrix.NAME == 'windows'
run: npm ci && npm run build:alpha

- name: Install app dependencies and build it
if: matrix.NAME == 'mac'
run: npm ci && npm run build:alpha -- --target universal-apple-darwin

- name: Remove useless folders
run: |
rm -rf core/target/release/build
rm -rf core/target/release/deps
rm -rf core/target/release/bundle/appimage/authme.AppDir
npm run rename
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: authme-latest-alpha-${{matrix.NAME}}-x64-installer-portable
path: core/target/release
53 changes: 0 additions & 53 deletions .github/workflows/beta-artifacts.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"
- name: Install modules
run: npm ci
- name: Setup project
Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release Artifacts
on:
push:
branches:
- main
tags:
- "*"
jobs:
test-tauri:
strategy:
Expand All @@ -19,25 +19,42 @@ jobs:
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install rust stable
uses: actions-rs/toolchain@v1
node-version: 20
cache: "npm"

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
toolchain: stable
workspaces: "./core -> target"

- name: "Apple silicon target"
if: matrix.NAME == 'mac'
run: |
rustup target add aarch64-apple-darwin
- name: Install webkit2gtk (ubuntu only)
if: matrix.NAME == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Install app dependencies and build it
run: npm ci && npm run build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.NAME == 'linux' || matrix.NAME == 'windows'
run: npm ci && npm run build:release

- name: Install app dependencies and build it
if: matrix.NAME == 'mac'
run: npm ci && npm run build:release -- --target universal-apple-darwin

- name: Remove useless folders
run: |
rm -rf core/target/release/build
Expand All @@ -50,7 +67,6 @@ jobs:
id: get_latest_release
with:
route: GET /repos/:repository/releases?per_page=1
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -105,6 +121,7 @@ jobs:
asset_path: ./core/target/release/upload/authme-${{steps.version.outputs.prop}}-linux-x64.appimage
asset_name: authme-${{steps.version.outputs.prop}}-linux-x64.appimage
asset_content_type: application/octet-stream

- name: Upload the linux installer asset
if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1.0.2
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"server": "node scripts/server.js",
"build": "node scripts/buildNumber.cjs release false && tauri build",
"build:alpha": "node scripts/buildNumber.cjs alpha false && tauri build",
"build:beta": "node scripts/buildNumber.cjs beta false && tauri build",
"build:bundle": "node scripts/build.js",
"setup": "node scripts/buildNumber.cjs alpha false && node scripts/build.js",
"rename": "node scripts/rename.js",
Expand Down
8 changes: 4 additions & 4 deletions scripts/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if (os === "win32") {
}
} else if (os === "darwin") {
try {
copyFileSync(`./core/target/release/bundle/dmg/Authme_${version}_x64.dmg`, `./core/target/release/upload/authme-${version}-macos-x64.dmg`)
copyFileSync("./core/target/release/bundle/macos/Authme.app.tar.gz", `./core/target/release/upload/authme-${version}-macos-x64.tar.gz`)
copyFileSync("./core/target/release/bundle/macos/Authme.app.tar.gz.sig", `./core/target/release/upload/authme-${version}-macos-x64.sig`)
copyFileSync(`./core/target/universal-apple-darwin/release/bundle/dmg/Authme_${version}_universal.dmg`, `./core/target/release/upload/authme-${version}-macos-x64.dmg`)
copyFileSync("./core/target/universal-apple-darwin/release/bundle/macos/Authme.app.tar.gz", `./core/target/release/upload/authme-${version}-macos-x64.tar.gz`)
copyFileSync("./core/target/universal-apple-darwin/release/bundle/macos/Authme.app.tar.gz.sig", `./core/target/release/upload/authme-${version}-macos-x64.sig`)
} catch (err) {
console.log("File not found")
console.log("File not found", err)
}
} else {
try {
Expand Down

0 comments on commit 2e8c159

Please sign in to comment.