Skip to content

Tagging up v1.4.2.5 #51

Tagging up v1.4.2.5

Tagging up v1.4.2.5 #51

# This workflow will also build the jaseci studio binaries
name: Build and Release Jaseci Studio
on:
push:
tags:
- "*"
jobs:
create-release:
runs-on: ubuntu-20.04
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
projectPath: "./jaseci_studio"
- name: Set versions
uses: actions/github-script@v6
id: set_version
with:
script: |
const tag = context.ref.substring(10)
const no_v_tag = tag.replace('v', '')
core.setOutput('no-v-tag', no_v_tag)
- name: create release
id: create-release
uses: actions/github-script@v6
with:
projectPath: "./jaseci_studio"
script: |
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${{steps.set_version.outputs.no-v-tag}}`,
name: `Jaseci v${{steps.set_version.outputs.no-v-tag}}`,
body: 'Source code and Jaseci Studio executables.',
draft: true,
prerelease: false
})
return data.id
build-tauri:
needs: create-release
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Set versions
uses: actions/github-script@v6
id: set_version
with:
script: |
const tag = context.ref.substring(10)
let no_v_tag = tag.replace('v', '')
if(no_v_tag.split(".")[3]) {
no_v_tag = no_v_tag.split(".").slice(0, 3).join(".")
}
core.setOutput('no-v-tag', no_v_tag)
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
projectPath: "./jaseci_studio"
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: prepare stencil ui components
run: yarn setup:ui
working-directory: "./jaseci_studio"
- name: install app dependencies and build it
run: yarn && yarn build
working-directory: "./jaseci_studio"
- name: bump version
id: bump-version
uses: jossef/action-set-json-field@v2.1
with:
file: ./jaseci_studio/src-tauri/tauri.conf.json
field: package.version
value: ${{ steps.set_version.outputs.no-v-tag }}
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
projectPath: "./jaseci_studio"
publish-release:
runs-on: ubuntu-20.04
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:
projectPath: "./jaseci_studio"
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: process.env.release_id,
draft: false,
prerelease: false
})