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