1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 04:03:29 +00:00

Fix workflow formatting (#17382)

This commit is contained in:
Vince Grassia
2025-11-13 21:56:37 -05:00
committed by Amy Galles
parent 7550d1109a
commit 1c0d8b2a93
5 changed files with 42 additions and 58 deletions

View File

@@ -66,15 +66,17 @@ jobs:
- name: Version output
id: version-output
env:
_INPUT_VERSION: ${{ inputs.version }}
INPUT_VERSION: ${{ inputs.version }}
run: |
if [[ "$_INPUT_VERSION" == "latest" || "$_INPUT_VERSION" == "" ]]; then
VERSION=$(curl "https://api.github.com/repos/bitwarden/clients/releases" | jq -c '.[] | select(.tag_name | contains("cli")) | .tag_name' | head -1 | grep -ohE '20[0-9]{2}\.([1-9]|1[0-2])\.[0-9]+')
if [[ "$INPUT_VERSION" == "latest" || "$INPUT_VERSION" == "" ]]; then
TAG_NAME=$(curl -s "https://api.github.com/repos/bitwarden/clients/releases" \
| jq -r '.[] | select(.tag_name | contains("cli")) | .tag_name' | head -1)
VERSION="${TAG_NAME#cli-v}"
echo "Latest Released Version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
else
echo "Release Version: $_INPUT_VERSION"
echo "version=$_INPUT_VERSION" >> "$GITHUB_OUTPUT"
echo "Release Version: $INPUT_VERSION"
echo "version=$INPUT_VERSION" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub deployment
@@ -126,14 +128,14 @@ jobs:
uses: samuelmeuli/action-snapcraft@fceeb3c308e76f3487e72ef608618de625fb7fe8 # v3.0.1
- name: Download artifacts
run: wget "https://github.com/bitwarden/clients/releases/download/cli-v$_PKG_VERSION/bw_$_PKG_VERSION_amd64.snap"
run: wget "https://github.com/bitwarden/clients/releases/download/cli-v${_PKG_VERSION}/bw_${_PKG_VERSION}_amd64.snap"
- name: Publish Snap & logout
if: ${{ inputs.publish_type != 'Dry Run' }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ steps.retrieve-secrets.outputs.snapcraft-store-token }}
run: |
snapcraft upload "bw_$_PKG_VERSION_amd64.snap" --release stable
snapcraft upload "bw_${_PKG_VERSION}_amd64.snap" --release stable
snapcraft logout
choco:
@@ -179,7 +181,7 @@ jobs:
run: New-Item -ItemType directory -Path ./dist
- name: Download artifacts
run: Invoke-WebRequest -Uri "https://github.com/bitwarden/clients/releases/download/cli-v$_PKG_VERSION/bitwarden-cli.$_PKG_VERSION.nupkg" -OutFile bitwarden-cli.$_PKG_VERSION.nupkg
run: Invoke-WebRequest -Uri "https://github.com/bitwarden/clients/releases/download/cli-v$($env:_PKG_VERSION)/bitwarden-cli.$($env:_PKG_VERSION).nupkg" -OutFile bitwarden-cli.$($env:_PKG_VERSION).nupkg
working-directory: apps/cli/dist
- name: Push to Chocolatey
@@ -227,8 +229,8 @@ jobs:
- name: Download and set up artifact
run: |
mkdir -p build
wget "https://github.com/bitwarden/clients/releases/download/cli-v$_PKG_VERSION/bitwarden-cli-$_PKG_VERSION-npm-build.zip"
unzip "bitwarden-cli-$_PKG_VERSION-npm-build.zip" -d build
wget "https://github.com/bitwarden/clients/releases/download/cli-v${_PKG_VERSION}/bitwarden-cli-${_PKG_VERSION}-npm-build.zip"
unzip "bitwarden-cli-${_PKG_VERSION}-npm-build.zip" -d build
- name: Publish NPM
if: ${{ inputs.publish_type != 'Dry Run' }}

View File

@@ -73,12 +73,11 @@ jobs:
- name: Check Publish Version
id: version
env:
_INPUT_VERSION: ${{ inputs.version }}
INPUT_VERSION: ${{ inputs.version }}
run: |
if [[ "$_INPUT_VERSION" == "latest" || "$_INPUT_VERSION" == "" ]]; then
TAG_NAME=$(curl "https://api.github.com/repos/bitwarden/clients/releases" \
| jq -c '.[] | select(.tag_name | contains("desktop")) | .tag_name' \
| head -1 | cut -d '"' -f 2)
if [[ "$INPUT_VERSION" == "latest" || "$INPUT_VERSION" == "" ]]; then
TAG_NAME=$(curl -s "https://api.github.com/repos/bitwarden/clients/releases" \
| jq -r '.[] | select(.tag_name | contains("desktop")) | .tag_name' | head -1)
VERSION="${TAG_NAME#desktop-v}"
echo "Latest Released Version: $VERSION"
@@ -87,7 +86,7 @@ jobs:
echo "Tag name: $TAG_NAME"
echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
else
VERSION="$_INPUT_VERSION"
VERSION="$INPUT_VERSION"
TAG_NAME="desktop-v$VERSION"
echo "Release Version: $VERSION"
@@ -100,9 +99,9 @@ jobs:
- name: Get Version Channel
id: release_channel
env:
_VERSION: ${{ steps.version.outputs.version }}
VERSION: ${{ steps.version.outputs.version }}
run: |
case "${_VERSION}" in
case "${VERSION}" in
*"alpha"*)
echo "channel=alpha" >> "$GITHUB_OUTPUT"
echo "[!] We do not yet support 'alpha'"
@@ -192,22 +191,6 @@ jobs:
--recursive \
--quiet
- name: Update deployment status to Success
if: ${{ inputs.publish_type != 'Dry Run' && success() }}
uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
with:
token: '${{ secrets.GITHUB_TOKEN }}'
state: 'success'
deployment-id: ${{ needs.setup.outputs.deployment_id }}
- name: Update deployment status to Failure
if: ${{ inputs.publish_type != 'Dry Run' && failure() }}
uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
with:
token: '${{ secrets.GITHUB_TOKEN }}'
state: 'failure'
deployment-id: ${{ needs.setup.outputs.deployment_id }}
snap:
name: Deploy Snap
runs-on: ubuntu-22.04
@@ -251,14 +234,14 @@ jobs:
- name: Download artifacts
working-directory: apps/desktop/dist
run: wget "https://github.com/bitwarden/clients/releases/download/$_RELEASE_TAG/bitwarden_$_PKG_VERSION_amd64.snap"
run: wget "https://github.com/bitwarden/clients/releases/download/${_RELEASE_TAG}/bitwarden_${_PKG_VERSION}_amd64.snap"
- name: Deploy to Snap Store
if: ${{ inputs.publish_type != 'Dry Run' }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ steps.retrieve-secrets.outputs.snapcraft-store-token }}
run: |
snapcraft upload "bitwarden_$_PKG_VERSION_amd64.snap" --release stable
snapcraft upload "bitwarden_${_PKG_VERSION}_amd64.snap" --release stable
snapcraft logout
working-directory: apps/desktop/dist
@@ -312,7 +295,7 @@ jobs:
- name: Download artifacts
working-directory: apps/desktop/dist
run: Invoke-WebRequest -Uri "https://github.com/bitwarden/clients/releases/download/$_RELEASE_TAG/bitwarden.$_PKG_VERSION.nupkg" -OutFile "bitwarden.$_PKG_VERSION.nupkg"
run: Invoke-WebRequest -Uri "https://github.com/bitwarden/clients/releases/download/$($env:_RELEASE_TAG)/bitwarden.$($env:_PKG_VERSION).nupkg" -OutFile "bitwarden.$($env:_PKG_VERSION).nupkg"
- name: Push to Chocolatey
if: ${{ inputs.publish_type != 'Dry Run' }}
@@ -337,7 +320,7 @@ jobs:
persist-credentials: false
- name: Validate release notes for MAS
if: inputs.mas_publish && (inputs.release_notes == '' || inputs.release_notes == null)
if: inputs.release_notes == '' || inputs.release_notes == null
run: |
echo "❌ Release notes are required when publishing to Mac App Store"
echo "Please provide release notes using the 'Release Notes' input field"
@@ -345,7 +328,7 @@ jobs:
- name: Download MacOS App Store build number
working-directory: apps/desktop
run: wget "https://github.com/bitwarden/clients/releases/download/$_RELEASE_TAG/macos-build-number.json"
run: wget "https://github.com/bitwarden/clients/releases/download/${_RELEASE_TAG}/macos-build-number.json"
- name: Setup Ruby and Install Fastlane
uses: ruby/setup-ruby@ca041f971d66735f3e5ff1e21cc13e2d51e7e535 # v1.233.0
@@ -379,20 +362,20 @@ jobs:
env:
APP_STORE_CONNECT_TEAM_ISSUER: ${{ steps.get-kv-secrets.outputs.APP-STORE-CONNECT-TEAM-ISSUER }}
APP_STORE_CONNECT_AUTH_KEY: ${{ steps.get-kv-secrets.outputs.APP-STORE-CONNECT-AUTH-KEY }}
_RELEASE_NOTES: ${{ inputs.release_notes }}
_PUBLISH_TYPE: ${{ inputs.publish_type }}
CHANGELOG: ${{ inputs.release_notes }}
PUBLISH_TYPE: ${{ inputs.publish_type }}
working-directory: apps/desktop
run: |
BUILD_NUMBER=$(jq -r '.buildNumber' macos-build-number.json)
CHANGELOG="$_RELEASE_NOTES"
IS_DRY_RUN="$_PUBLISH_TYPE == 'Dry Run'"
if [ "$IS_DRY_RUN" = "true" ]; then
if [ "$PUBLISH_TYPE" = "Dry Run" ]; then
echo "🧪 DRY RUN MODE - Testing without actual App Store submission"
echo "📦 Would publish build $BUILD_NUMBER to Mac App Store"
IS_DRY_RUN="true"
else
echo "🚀 PRODUCTION MODE - Publishing to Mac App Store"
echo "📦 Publishing build $BUILD_NUMBER to Mac App Store"
IS_DRY_RUN="false"
fi
echo "📝 Release notes (${#CHANGELOG} chars): ${CHANGELOG:0:100}..."
@@ -404,7 +387,7 @@ jobs:
fi
fastlane publish --verbose \
app_version:"$PKG_VERSION" \
app_version:"${_PKG_VERSION}" \
build_number:"$BUILD_NUMBER" \
changelog:"$CHANGELOG" \
dry_run:"$IS_DRY_RUN"

View File

@@ -132,11 +132,11 @@ jobs:
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"
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' }}

View File

@@ -58,9 +58,9 @@ jobs:
- name: Get Version Channel
id: release_channel
env:
_VERSION: ${{ steps.version.outputs.version }}
VERSION: ${{ steps.version.outputs.version }}
run: |
case "$_VERSION" in
case "$VERSION" in
*"alpha"*)
echo "channel=alpha" >> "$GITHUB_OUTPUT"
echo "[!] We do not yet support 'alpha'"
@@ -96,7 +96,7 @@ jobs:
env:
PKG_VERSION: ${{ steps.version.outputs.version }}
working-directory: apps/desktop/artifacts
run: mv "Bitwarden-$PKG_VERSION-universal.pkg" "Bitwarden-$PKG_VERSION-universal.pkg.archive"
run: mv "Bitwarden-${PKG_VERSION}-universal.pkg" "Bitwarden-${PKG_VERSION}-universal.pkg.archive"
- name: Create Release
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0

View File

@@ -52,8 +52,7 @@ jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-22.04
needs:
- setup
needs: setup
permissions:
contents: write
steps:
@@ -82,10 +81,10 @@ jobs:
- name: Rename assets
working-directory: apps/web/artifacts
env:
_RELEASE_VERSION: ${{ needs.setup.outputs.release_version }}
RELEASE_VERSION: ${{ needs.setup.outputs.release_version }}
run: |
mv web-*-selfhosted-COMMERCIAL.zip "web-$_RELEASE_VERSION-selfhosted-COMMERCIAL.zip"
mv web-*-selfhosted-open-source.zip "web-$_RELEASE_VERSION-selfhosted-open-source.zip"
mv web-*-selfhosted-COMMERCIAL.zip "web-${RELEASE_VERSION}-selfhosted-COMMERCIAL.zip"
mv web-*-selfhosted-open-source.zip "web-${RELEASE_VERSION}-selfhosted-open-source.zip"
- name: Create release
if: ${{ github.event.inputs.release_type != 'Dry Run' }}