-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
108 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,107 @@ | ||
# name: "publish" | ||
|
||
# on: pull_request | ||
|
||
# # `tauri-action` can also upload app bundles to an existing GitHub release. | ||
# # This workflow uses different actions to create and publish the release. | ||
# # `tauri-action` will only build and upload the app bundles to the specified release. | ||
|
||
# jobs: | ||
# create-release: | ||
# permissions: | ||
# contents: write | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# release_id: ${{ steps.create-release.outputs.result }} | ||
|
||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - name: setup node | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: lts/* | ||
|
||
# - name: get version | ||
# run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | ||
|
||
# - name: create release | ||
# id: create-release | ||
# uses: actions/github-script@v6 | ||
# with: | ||
# script: | | ||
# const { data } = await github.rest.repos.createRelease({ | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# tag_name: `app-v${process.env.PACKAGE_VERSION}`, | ||
# name: `Desktop App v${process.env.PACKAGE_VERSION}`, | ||
# body: 'Take a look at the assets to download and install this app.', | ||
# draft: true, | ||
# prerelease: false | ||
# }) | ||
# return data.id | ||
|
||
# build-tauri: | ||
# needs: create-release | ||
# permissions: | ||
# contents: write | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# include: | ||
# - platform: "windows-latest" | ||
# args: "" | ||
|
||
# runs-on: ${{ matrix.platform }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - name: setup node | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: lts/* | ||
|
||
# - 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: install frontend dependencies | ||
# run: | | ||
# npm install | ||
# npm run fetch-packages | ||
|
||
# - uses: tauri-apps/tauri-action@v0 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# releaseId: ${{ needs.create-release.outputs.release_id }} | ||
# args: ${{ matrix.args }} | ||
|
||
# publish-release: | ||
# permissions: | ||
# contents: write | ||
# runs-on: ubuntu-latest | ||
# needs: [create-release, build-tauri] | ||
|
||
# steps: | ||
# - name: publish release | ||
# id: publish-release | ||
# uses: actions/github-script@v6 | ||
# env: | ||
# release_id: ${{ needs.create-release.outputs.release_id }} | ||
# with: | ||
# script: | | ||
# github.rest.repos.updateRelease({ | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# release_id: process.env.release_id, | ||
# draft: false, | ||
# prerelease: false | ||
# }) | ||
name: "publish" | ||
|
||
# on: | ||
# push: | ||
# tags: | ||
# - "tchap-*" | ||
|
||
on: [pull_request] | ||
|
||
# `tauri-action` can also upload app bundles to an existing GitHub release. | ||
# This workflow uses different actions to create and publish the release. | ||
# `tauri-action` will only build and upload the app bundles to the specified release. | ||
|
||
jobs: | ||
create-release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_id: ${{ steps.create-release.outputs.result }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: get version | ||
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | ||
|
||
- name: create release | ||
id: create-release | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { data } = await github.rest.repos.createRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: `app-v${process.env.PACKAGE_VERSION}`, | ||
name: `Desktop App v${process.env.PACKAGE_VERSION}`, | ||
body: 'Take a look at the assets to download and install this app.', | ||
draft: true, | ||
prerelease: false | ||
}) | ||
return data.id | ||
build-tauri: | ||
needs: create-release | ||
permissions: | ||
contents: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: "windows-latest" | ||
args: "" | ||
|
||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- 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: install frontend dependencies | ||
run: | | ||
npm install | ||
npm run fetch-packages | ||
- uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
releaseId: ${{ needs.create-release.outputs.release_id }} | ||
args: ${{ matrix.args }} | ||
|
||
publish-release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: [create-release, build-tauri] | ||
|
||
steps: | ||
- name: publish release | ||
id: publish-release | ||
uses: actions/github-script@v6 | ||
env: | ||
release_id: ${{ needs.create-release.outputs.release_id }} | ||
with: | ||
script: | | ||
github.rest.repos.updateRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: process.env.release_id, | ||
draft: false, | ||
prerelease: false | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters