This commit is contained in:
parent
c234a1d1f9
commit
9f9c4ff508
@ -3,45 +3,13 @@ name: 'publish'
|
|||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
publish-tauri:
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
release_id: ${{ steps.create-release.outputs.result }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: setup node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
- name: get version
|
|
||||||
run: echo "PACKAGE_VERSION=$(node -p "require('./toos-dashboard/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:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ubuntu-latest]
|
platform: [ubuntu-20.04]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
@ -53,11 +21,10 @@ jobs:
|
|||||||
- name: install Rust stable
|
- name: install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.platform == 'ubuntu-20.04'
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
sudo apt-get update
|
||||||
apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
|
||||||
npm install -g vite
|
|
||||||
- name: install frontend dependencies
|
- name: install frontend dependencies
|
||||||
run: yarn install # change this to npm or pnpm depending on which one you use
|
run: yarn install # change this to npm or pnpm depending on which one you use
|
||||||
workdir: toos-dashboard/
|
workdir: toos-dashboard/
|
||||||
@ -66,27 +33,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
releaseId: ${{ needs.create-release.outputs.release_id }}
|
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
|
||||||
|
releaseName: 'App v__VERSION__'
|
||||||
publish-release:
|
releaseBody: 'See the assets to download this version and install.'
|
||||||
permissions:
|
releaseDraft: true
|
||||||
contents: write
|
prerelease: false
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [create-release, build-tauri]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: publish release
|
|
||||||
id: publish-release
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
workdir: toos-dashboard/
|
|
||||||
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
|
|
||||||
})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user