Browse Source

[BRE-127] Remove version input in self host release (#275)

* [BRE-127] Remove Version input in self-host Release

* Fix run-name

* Add echo

* Strip v from latest version

* Fix indentation

* Fix

* FIx

* Change name

* Echo next version

* Fix

* Remove testing steps
pull/277/head
Michał Chęciński 1 year ago committed by GitHub
parent
commit
2239d21465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 29
      .github/workflows/release.yml

29
.github/workflows/release.yml

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

Loading…
Cancel
Save