--- name: Release on: workflow_dispatch: inputs: release_type: description: 'Release Options' required: true default: 'Initial Release' type: choice options: - Initial Release - Redeploy - Dry Run jobs: setup: name: Setup runs-on: ubuntu-22.04 outputs: release-version: ${{ steps.version.outputs.version }} steps: - name: Checkout repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - 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@main with: release-type: ${{ github.event.inputs.release_type }} project-type: ts file: package.json release: name: Release runs-on: ubuntu-22.04 needs: setup steps: - name: Create GitHub deployment uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5 id: deployment with: token: '${{ secrets.GITHUB_TOKEN }}' initial-status: 'in_progress' environment: 'production' description: 'Deployment ${{ needs.setup.outputs.release-version }} from branch ${{ github.ref_name }}' task: release - name: Download all artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@main with: workflow: build.yml workflow_conclusion: success branch: ${{ github.ref_name }} - name: Download all artifacts if: ${{ github.event.inputs.release_type == 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@main with: workflow: build.yml workflow_conclusion: success branch: main - name: Create release if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 env: PKG_VERSION: ${{ needs.setup.outputs.release-version }} with: artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip, ./bwdc-macos-${{ env.PKG_VERSION }}.zip, ./bwdc-linux-${{ env.PKG_VERSION }}.zip, ./bwdc-windows-sha256-${{ env.PKG_VERSION }}.txt, ./bwdc-macos-sha256-${{ env.PKG_VERSION }}.txt, ./bwdc-linux-sha256-${{ env.PKG_VERSION }}.txt, ./Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe, ./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe, ./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe.blockmap, ./Bitwarden-Connector-${{ env.PKG_VERSION }}-x86_64.AppImage, ./Bitwarden-Connector-${{ env.PKG_VERSION }}-mac.zip, ./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg, ./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg.blockmap, ./latest-linux.yml, ./latest-mac.yml, ./latest.yml" commit: ${{ github.sha }} tag: v${{ env.PKG_VERSION }} name: Version ${{ env.PKG_VERSION }} body: "" token: ${{ secrets.GITHUB_TOKEN }} draft: true - name: Update deployment status to Success if: ${{ success() }} uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1 with: token: '${{ secrets.GITHUB_TOKEN }}' state: 'success' deployment-id: ${{ steps.deployment.outputs.deployment_id }} - name: Update deployment status to Failure if: ${{ failure() }} uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1 with: token: '${{ secrets.GITHUB_TOKEN }}' state: 'failure' deployment-id: ${{ steps.deployment.outputs.deployment_id }}