2022-06-03 16:35:46 +02:00
|
|
|
name: Release Web
|
2022-11-08 16:02:51 +01:00
|
|
|
run-name: Release Web ${{ inputs.release_type }}
|
2021-06-02 17:28:56 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2021-12-20 18:15:43 +01:00
|
|
|
inputs:
|
|
|
|
release_type:
|
|
|
|
description: 'Release Options'
|
|
|
|
required: true
|
|
|
|
default: 'Initial Release'
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- Initial Release
|
|
|
|
- Redeploy
|
2022-02-25 15:07:54 +01:00
|
|
|
- Dry Run
|
2021-06-02 17:28:56 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
2021-09-02 22:05:17 +02:00
|
|
|
name: Setup
|
2023-08-16 06:37:41 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-06-02 17:28:56 +02:00
|
|
|
outputs:
|
2022-06-01 03:08:32 +02:00
|
|
|
release_version: ${{ steps.version.outputs.version }}
|
2022-06-03 16:35:46 +02:00
|
|
|
tag_version: ${{ steps.version.outputs.tag }}
|
2021-06-02 17:28:56 +02:00
|
|
|
steps:
|
2022-06-30 19:26:35 +02:00
|
|
|
- name: Checkout repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2022-06-30 19:26:35 +02:00
|
|
|
|
2021-06-02 17:28:56 +02:00
|
|
|
- name: Branch check
|
2022-02-25 15:07:54 +01:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2021-06-02 17:28:56 +02:00
|
|
|
run: |
|
2022-11-16 16:48:49 +01:00
|
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc-web" ]]; then
|
2021-06-02 17:28:56 +02:00
|
|
|
echo "==================================="
|
2022-08-16 17:55:57 +02:00
|
|
|
echo "[!] Can only release from the 'rc' or 'hotfix-rc-web' branches"
|
2021-06-02 17:28:56 +02:00
|
|
|
echo "==================================="
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-09-21 18:37:17 +02:00
|
|
|
- name: Check Release Version
|
|
|
|
id: version
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/release-version-check@main
|
2022-06-01 01:11:26 +02:00
|
|
|
with:
|
|
|
|
release-type: ${{ github.event.inputs.release_type }}
|
|
|
|
project-type: ts
|
2022-06-03 16:35:46 +02:00
|
|
|
file: apps/web/package.json
|
|
|
|
monorepo: true
|
|
|
|
monorepo-project: web
|
2021-09-21 18:37:17 +02:00
|
|
|
|
|
|
|
release:
|
|
|
|
name: Create GitHub Release
|
2023-08-16 06:37:41 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-09-21 18:37:17 +02:00
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
steps:
|
2021-10-08 18:54:42 +02:00
|
|
|
- name: Download latest build artifacts
|
2022-07-01 17:44:20 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2021-09-21 18:37:17 +02:00
|
|
|
with:
|
2022-06-03 16:35:46 +02:00
|
|
|
workflow: build-web.yml
|
|
|
|
path: apps/web/artifacts
|
2021-09-21 18:37:17 +02:00
|
|
|
workflow_conclusion: success
|
2022-06-22 14:32:45 +02:00
|
|
|
branch: ${{ github.ref_name }}
|
2021-10-08 18:54:42 +02:00
|
|
|
artifacts: "web-*-selfhosted-COMMERCIAL.zip,
|
2021-12-17 15:57:11 +01:00
|
|
|
web-*-selfhosted-open-source.zip"
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2022-11-14 15:35:42 +01:00
|
|
|
- name: Dry Run - Download latest build artifacts
|
2022-07-01 17:44:20 +02:00
|
|
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-07-01 17:44:20 +02:00
|
|
|
with:
|
|
|
|
workflow: build-web.yml
|
|
|
|
path: apps/web/artifacts
|
|
|
|
workflow_conclusion: success
|
2023-12-12 20:57:50 +01:00
|
|
|
branch: main
|
2022-07-01 17:44:20 +02:00
|
|
|
artifacts: "web-*-selfhosted-COMMERCIAL.zip,
|
|
|
|
web-*-selfhosted-open-source.zip"
|
|
|
|
|
2021-10-08 18:54:42 +02:00
|
|
|
- name: Rename assets
|
2022-06-03 16:35:46 +02:00
|
|
|
working-directory: apps/web/artifacts
|
2021-10-08 18:54:42 +02:00
|
|
|
run: |
|
|
|
|
mv web-*-selfhosted-COMMERCIAL.zip web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip
|
|
|
|
mv web-*-selfhosted-open-source.zip web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip
|
2021-06-02 17:28:56 +02:00
|
|
|
|
2021-09-21 18:37:17 +02:00
|
|
|
- name: Create release
|
2022-02-25 15:07:54 +01:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
|
2021-09-21 18:37:17 +02:00
|
|
|
with:
|
2022-08-03 00:01:30 +02:00
|
|
|
name: "Web v${{ needs.setup.outputs.release_version }}"
|
2021-09-21 18:37:17 +02:00
|
|
|
commit: ${{ github.sha }}
|
2022-08-03 00:01:30 +02:00
|
|
|
tag: web-v${{ needs.setup.outputs.release_version }}
|
2021-09-21 18:37:17 +02:00
|
|
|
body: "<insert release notes here>"
|
2022-06-03 16:35:46 +02:00
|
|
|
artifacts: "apps/web/artifacts/web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip,
|
|
|
|
apps/web/artifacts/web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip"
|
2021-09-21 18:37:17 +02:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-27 22:08:37 +02:00
|
|
|
draft: true
|