Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
client:
type: boolean
description: "Release Client"
default: true
web:
type: boolean
description: "Deploy Web"
default: false
pre_release:
type: boolean
description: "Pre-release"
default: true
version_type:
type: choice
description: "Version type"
options:
- minor
# - major
- patch
default: patch
jobs:
release_client:
name: Build and Release Client
runs-on: macOS
if: ${{ github.event.inputs.client }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.FLORA_GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Enable corepack
run: corepack enable yarn
- name: Bump minor version
if: ${{ github.event.inputs.version_type == 'minor' }}
run: |
yarn version minor
- name: Bump patch version
if: ${{ github.event.inputs.version_type == 'patch' }}
run: |
yarn version patch
- name: set on environment variable
run: |
NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
# - name: Bump @lichtblick/suite version
# run: yarn version minor
# working-directory: packages/suite
- name: Install dependencies
run: yarn install --immutable
- name: Build prod files
run: |
yarn run desktop:build:prod
- name: Build windows version
run: yarn run package:win
- name: Build linux version
run: yarn run package:linux
- name: Build macOS version
run: yarn run package:darwin
# Important to use [skip actions] to avoid triggering other verisoning workflows
# https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/skipping-workflow-runs
- name: Commit and tag the new version
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package.json packages/suite/package.json yarn.lock
git commit -m "Bump version v${{ env.new_version }} [skip actions]"
git tag "v${{ env.new_version }}"
git push origin main --tags
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: "v${{ env.new_version }}"
name: "v${{ env.new_version }}"
commit: main
generateReleaseNotes: true
prerelease: ${{ github.event.inputs.pre_release }}
token: ${{ secrets.FLORA_GITHUB_TOKEN }}
artifacts: |
dist/flora-${{ env.new_version }}-linux-amd64.deb
dist/flora-${{ env.new_version }}-linux-x64.tar.gz
dist/flora-${{ env.new_version }}-mac-universal.dmg
dist/flora-${{ env.new_version }}-win.exe
dist/latest-linux.yml
dist/latest-mac.yml
dist/latest.yml
deploy_web:
name: Deploy to Web
runs-on: ubuntu-20.04
if: ${{ github.event.inputs.web }}
env:
# Environment variables that are injected into the build
ENABLE_EXPERIMENTAL_COREPACK: 1
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: true
- uses: actions/setup-node@v4.0.3
with:
node-version: lts/*
- run: corepack enable
- run: yarn install --immutable
- run: yarn web:build:prod
- uses: NiceLabs/rclone-action@master
with:
github-token: ${{ secrets.FLORA_GITHUB_TOKEN }}
config: ${{ secrets.RCLONE_CONFIG }}
config-secret-name: RCLONE_CONFIG
- name: Upload Pre-built images
run: rclone sync web/.webpack/ flora-app:/flora-app/