mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-13 14:53:16 +00:00
Update release workflow to match clients (#368)
This commit is contained in:
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
@@ -18,7 +18,12 @@ jobs:
|
|||||||
setup:
|
setup:
|
||||||
name: Setup
|
name: Setup
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
release-version: ${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
run: |
|
run: |
|
||||||
@@ -29,37 +34,19 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Check Release Version
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
id: version
|
||||||
|
uses: bitwarden/gh-actions/release-version-check@master
|
||||||
- name: Retrieve Directory Connector release version
|
with:
|
||||||
id: retrieve-version
|
release-type: ${{ github.event.inputs.release_type }}
|
||||||
run: |
|
project-type: ts
|
||||||
PKG_VERSION=$(jq -r .version src/package.json)
|
file: src/package.json
|
||||||
echo "package_version=$PKG_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Check to make sure Mobile release version has been bumped
|
|
||||||
if: ${{ github.event.inputs.release_type == 'Initial Release' }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
latest_ver=$(hub release -L 1 -f '%T')
|
|
||||||
latest_ver=${latest_ver:1}
|
|
||||||
echo "Latest version: $latest_ver"
|
|
||||||
ver=${{ steps.retrieve-version.outputs.package_version }}
|
|
||||||
echo "Version: $ver"
|
|
||||||
if [ "$latest_ver" = "$ver" ]; then
|
|
||||||
echo "Version has not been bumped!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Get branch name
|
|
||||||
id: branch
|
|
||||||
run: |
|
|
||||||
BRANCH_NAME=$(basename ${{ github.ref }})
|
|
||||||
echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: setup
|
||||||
|
steps:
|
||||||
- name: Create GitHub deployment
|
- name: Create GitHub deployment
|
||||||
uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5
|
uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5
|
||||||
id: deployment
|
id: deployment
|
||||||
@@ -67,7 +54,7 @@ jobs:
|
|||||||
token: '${{ secrets.GITHUB_TOKEN }}'
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
initial-status: 'in_progress'
|
initial-status: 'in_progress'
|
||||||
environment: 'production'
|
environment: 'production'
|
||||||
description: 'Deployment ${{ steps.retrieve-version.outputs.package_version }} from branch ${{ steps.branch.outputs.branch-name }}'
|
description: 'Deployment ${{ needs.setup.outputs.release-version }} from branch ${{ github.ref_name }}'
|
||||||
task: release
|
task: release
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
@@ -76,7 +63,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: ${{ steps.branch.outputs.branch-name }}
|
branch: ${{ github.ref_name }}
|
||||||
|
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
||||||
@@ -90,7 +77,7 @@ jobs:
|
|||||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
||||||
env:
|
env:
|
||||||
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
PKG_VERSION: ${{ needs.setup.outputs.release-version }}
|
||||||
with:
|
with:
|
||||||
artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip,
|
artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip,
|
||||||
./bwdc-macos-${{ env.PKG_VERSION }}.zip,
|
./bwdc-macos-${{ env.PKG_VERSION }}.zip,
|
||||||
|
|||||||
Reference in New Issue
Block a user