diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d92d9f..c7f443f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,10 @@ --- name: Release -run-name: Release ${{ github.event.inputs.release_type }} v${{ github.event.inputs.release_version }} +run-name: Release ${{ github.event.inputs.release_type }} on: workflow_dispatch: inputs: - release_version: - description: "Release Version" - required: true release_type: description: "Release Options" required: true @@ -27,6 +24,7 @@ jobs: outputs: _WEB_RELEASE_TAG: ${{ steps.set-tags.outputs.WEB_RELEASE_TAG }} _CORE_RELEASE_TAG: ${{ steps.set-tags.outputs.CORE_RELEASE_TAG }} + _VERSION: ${{ steps.get-next-version.outputs.version }} steps: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} @@ -47,15 +45,18 @@ jobs: with: repository: bitwarden/self-host - - name: Check Release Version + - name: Strip version env: - RELEASE_VERSION: ${{ github.event.inputs.release_version }} - PREVIOUS_RELEASE_VERSION: ${{ steps.get-self-host.outputs.version }} + CURRENT_VERSION: ${{ steps.get-self-host.outputs.version }} run: | - if [ "$RELEASE_VERSION" == "$PREVIOUS_RELEASE_VERSION" ]; then - echo "[!] Already released v$RELEASE_VERSION. Please bump version to continue" - exit 1 - fi + VERSION_STRIPPED=$(echo $CURRENT_VERSION | sed 's/^v//') + echo "VERSION=$VERSION_STRIPPED" >> $GITHUB_ENV + + - name: Get Next Release Version + id: get-next-version + uses: bitwarden/gh-actions/version-next@main + with: + version: ${{ env.VERSION }} - name: Set Release Tags id: set-tags @@ -86,8 +87,8 @@ jobs: run.ps1, version.json' commit: ${{ github.sha }} - tag: "v${{ github.event.inputs.release_version }}" - name: "Version ${{ github.event.inputs.release_version }}" + tag: "v${{ needs.setup.outputs._VERSION }}" + name: "Version ${{ needs.setup.outputs._VERSION }}" body: "" token: ${{ secrets.GITHUB_TOKEN }} draft: true @@ -232,7 +233,7 @@ jobs: - setup - release env: - _RELEASE_VERSION: ${{ github.event.inputs.release_version }}-beta # TODO: remove `-beta` after GA + _RELEASE_VERSION: ${{ needs.setup.outputs._VERSION }}-beta # TODO: remove `-beta` after GA steps: ########## DockerHub ########## - name: Setup DCT