Skip to content

Commit

Permalink
Merge pull request #103 from takanotume24/develop
Browse files Browse the repository at this point in the history
Release v0.2.1
  • Loading branch information
takanotume24 authored Dec 4, 2024
2 parents ad3e849 + 2355e27 commit 27685b3
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 185 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/cleanup-chaches-by-a-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed

jobs:
cleanup:
if: ${{ !(github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'develop') }}
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
echo "Fetching list of cache key"
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
81 changes: 48 additions & 33 deletions .github/workflows/publish-to-auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ name: "publish"
on:
push:
branches:
- release/**

# This is the example from the readme.
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
- main

jobs:
publish-tauri:
permissions:
contents: write
test-tauri:
strategy:
fail-fast: false
matrix:
Expand All @@ -32,7 +27,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
Expand All @@ -50,40 +45,60 @@ jobs:

- name: install frontend dependencies
run: npm install # change this to npm, pnpm or bun depending on which one you use.


# If tagName and releaseId are omitted tauri-action will only build the app and won't try to upload any assets.
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: ${{ matrix.args }}

- name: Extract version from branch name
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/heads/release/}
if [[ -z "$VERSION" ]]; then
echo "Error: Version could not be extracted from the branch name."
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Update version number
run: ./script/update_version $VERSION

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
publish-tauri:
needs: test-tauri
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above).
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04.
args: ""
- platform: "windows-latest"
args: ""

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Commit changes
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
run: |
git add .
git commit -m "Automated commit from GitHub Actions"
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: npm install # change this to npm, pnpm or bun depending on which one you use.

- name: Push changes
uses: ad-m/[email protected]
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
args: ${{ matrix.args }}

- uses: tauri-apps/tauri-action@v0
env:
Expand All @@ -94,4 +109,4 @@ jobs:
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}
args: ${{ matrix.args }}
11 changes: 8 additions & 3 deletions .github/workflows/test-build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: "build"
on:
push:
branches-ignore:
- release
- main
pull_request:

jobs:
test-tauri:
strategy:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: ".nvmrc"

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
Expand All @@ -47,6 +47,11 @@ jobs:
- name: install frontend dependencies
run: npm install # change this to npm, pnpm or bun depending on which one you use.

- uses: Swatinem/rust-cache@v2
with:
workspaces: "src-tauri"
key: ${{ matrix.platform }}-${{ matrix.args }}

# If tagName and releaseId are omitted tauri-action will only build the app and won't try to upload any assets.
- uses: tauri-apps/tauri-action@v0
env:
Expand Down
Loading

0 comments on commit 27685b3

Please sign in to comment.