mirror of
https://github.com/bitwarden/browser.git
synced 2024-08-31 00:01:03 +02:00
* disabling snap for testing * adding in environment logging * adding in some Dry Run logic * adding more protected dry run logic * skipping long running steps for testing purposes * testing out windowws-2022 runner * Trying a different GitHub Action expression syntax * manually disabling jobs because I don't have time to figure out GitHub's weird syntax * updating nuget on windows-2019 * disabling the nuget version 6 * trying more GitHub Action syntax * disabling choco for testing * running test on Dry Run release * changing the double quotes to single quotes inside the GitHub Action expression * removing testing code * updating more dry run logic * reverting a branch name change
144 lines
4.8 KiB
YAML
144 lines
4.8 KiB
YAML
---
|
|
name: Release Browser
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_type:
|
|
description: 'Release Options'
|
|
required: true
|
|
default: 'Initial Release'
|
|
type: choice
|
|
options:
|
|
- Initial Release
|
|
- Redeploy
|
|
- Dry Run
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-20.04
|
|
outputs:
|
|
release-version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
|
|
|
- name: Branch check
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
|
run: |
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then
|
|
echo "==================================="
|
|
echo "[!] Can only release from the 'rc' or 'hotfix-rc/*' branches"
|
|
echo "==================================="
|
|
exit 1
|
|
fi
|
|
|
|
- name: Check Release Version
|
|
id: version
|
|
uses: bitwarden/gh-actions/release-version-check@ea9fab01d76940267b4147cc1c4542431246b9f6
|
|
with:
|
|
release-type: ${{ github.event.inputs.release_type }}
|
|
project-type: ts
|
|
file: apps/browser/src/manifest.json
|
|
monorepo: true
|
|
monorepo-project: browser
|
|
|
|
|
|
locales-test:
|
|
name: Locales Test
|
|
runs-on: ubuntu-20.04
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
|
|
|
- name: Testing locales - extName length
|
|
run: |
|
|
found_error=false
|
|
|
|
echo "Locales Test"
|
|
echo "============"
|
|
echo "extName string must be 40 characters or less"
|
|
echo
|
|
for locale in $(ls src/_locales/); do
|
|
string_length=$(jq '.extName.message | length' src/_locales/$locale/messages.json)
|
|
if [[ $string_length -gt 40 ]]; then
|
|
echo "$locale: $string_length"
|
|
found_error=true
|
|
fi
|
|
done
|
|
|
|
if $found_error; then
|
|
echo
|
|
echo "Please fix 'extName' for the locales listed above."
|
|
exit 1
|
|
else
|
|
echo "Test passed!"
|
|
fi
|
|
working-directory: apps/browser
|
|
|
|
|
|
release:
|
|
name: Create GitHub Release
|
|
runs-on: ubuntu-20.04
|
|
needs:
|
|
- setup
|
|
- locales-test
|
|
steps:
|
|
- name: Download latest Release build artifacts
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
|
uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8
|
|
with:
|
|
workflow: build-browser.yml
|
|
workflow_conclusion: success
|
|
branch: ${{ github.ref_name }}
|
|
artifacts: 'browser-source-*.zip,
|
|
dist-chrome-*.zip,
|
|
dist-opera-*.zip,
|
|
dist-firefox-*.zip,
|
|
dist-edge-*.zip'
|
|
|
|
- name: Download latest master build artifacts
|
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
|
uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8
|
|
with:
|
|
workflow: build-browser.yml
|
|
workflow_conclusion: success
|
|
branch: master
|
|
artifacts: 'browser-source-*.zip,
|
|
dist-chrome-*.zip,
|
|
dist-opera-*.zip,
|
|
dist-firefox-*.zip,
|
|
dist-edge-*.zip'
|
|
|
|
- name: Rename build artifacts
|
|
env:
|
|
PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }}
|
|
run: |
|
|
mv browser-source.zip browser-source-$PACKAGE_VERSION.zip
|
|
mv dist-chrome.zip dist-chrome-$PACKAGE_VERSION.zip
|
|
mv dist-opera.zip dist-opera-$PACKAGE_VERSION.zip
|
|
mv dist-firefox.zip dist-firefox-$PACKAGE_VERSION.zip
|
|
mv dist-edge.zip dist-edge-$PACKAGE_VERSION.zip
|
|
|
|
- name: Create release
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
|
uses: ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01
|
|
with:
|
|
artifacts: 'browser-source-${{ needs.setup.outputs.release-version }}.zip,
|
|
dist-chrome-${{ needs.setup.outputs.release-version }}.zip,
|
|
dist-opera-${{ needs.setup.outputs.release-version }}.zip,
|
|
dist-firefox-${{ needs.setup.outputs.release-version }}.zip,
|
|
dist-edge-${{ needs.setup.outputs.release-version }}.zip'
|
|
commit: ${{ github.sha }}
|
|
tag: "browser-v${{ needs.setup.outputs.release-version }}"
|
|
name: "Browser v${{ needs.setup.outputs.release-version }}"
|
|
body: "<insert release notes here>"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
draft: true
|