Release Beta Version #54
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
name: 'Release Beta Version' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '42 22 * * *' | |
jobs: | |
get-commit: | |
name: Get commit message | |
runs-on: ubuntu-latest | |
outputs: | |
msg: ${{ steps.set-msg.outputs.msg }} | |
steps: | |
- name: 'Checkout repository' | |
uses: 'actions/checkout@v4' | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- id: set-msg | |
name: 'Set commit message variable' | |
run: | | |
commitMessages=$(git log $(git describe --tags --abbrev=0)..@ --pretty=format:"%s" --no-merges | sed '/chore(deps/d' | sed '2,$d') | |
echo "msg=${commitMessages}" | |
echo "msg=${commitMessages}" >> $GITHUB_OUTPUT | |
bump-version: | |
name: 'Bump version' | |
needs: get-commit | |
if: ${{ needs.get-commit.outputs.msg != '' && needs.get-commit.outputs.msg != null && !contains(needs.get-commit.outputs.msg, 'chore(release)') && !contains(needs.get-commit.outputs.msg, 'version bump') }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: 'Checkout repository' | |
uses: 'actions/checkout@v4' | |
with: | |
persist-credentials: false | |
- name: 'Automated Version Bump' | |
id: version-bump | |
uses: 'phips28/[email protected]' | |
with: | |
version-type: prerelease | |
preid: 'beta' | |
tag-prefix: 'v' | |
skip-tag: 'true' | |
bump-policy: 'last-commit' | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
- name: 'Output new version' | |
env: | |
NEW_VERSION: ${{ steps.version-bump.outputs.newTag }} | |
run: echo "new version $NEW_VERSION" | |
outputs: | |
newTag: ${{ steps.version-bump.outputs.newTag }} | |
draft-release: | |
name: 'Draft release' | |
runs-on: ubuntu-latest | |
needs: bump-version | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create draft release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ needs.bump-version.outputs.newTag }} | |
tag: ${{ needs.bump-version.outputs.newTag }} | |
commit: 'master' | |
draft: true | |
prerelease: true | |
generateReleaseNotes: true | |
outputs: | |
id: ${{ steps.create_release.outputs.id }} | |
build: | |
runs-on: ${{ matrix.os }} | |
needs: draft-release | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
check-latest: true | |
cache: 'yarn' | |
- name: Install dependencies | |
if: matrix.os != 'windows-latest' | |
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
run: yarn install | |
- name: Set env variables | |
run: | | |
touch .env | |
echo SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} >> .env | |
echo SENTRY_ORG=${{ secrets.SENTRY_ORG }} >> .env | |
echo SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }} >> .env | |
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env | |
echo SENTRY_SOURCE_MAPS=1 >> .env | |
echo ZOOM_SDK_KEY=${{ secrets.ZOOM_SDK_KEY }} >> .env | |
echo ZOOM_SIGNATURE_ENDPOINT=${{ secrets.ZOOM_SIGNATURE_ENDPOINT }} >> .env | |
- name: Prepare build | |
run: | | |
yarn prebuild | |
yarn compile | |
- name: Build Electron app | |
env: | |
GH_TOKEN: ${{ secrets.github_token }} | |
run: yarn run build -p always | |
publish-release: | |
name: 'Publish release' | |
runs-on: ubuntu-latest | |
needs: [bump-version, build] | |
steps: | |
- uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ needs.bump-version.outputs.newTag }} | |
tag: ${{ needs.bump-version.outputs.newTag }} | |
draft: false | |
prerelease: true | |
allowUpdates: true | |
omitBodyDuringUpdate: true | |
updateOnlyUnreleased: true | |
token: ${{ secrets.PERSONAL_TOKEN }} |