Browse Source

Feature/release workflow version check (#19)

* Updating the version check to match stricter on the new version convention

* updating the release version check to use the new action
pull/21/head
Joseph Flinn 4 years ago committed by GitHub
parent
commit
3196ae9c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      .github/workflows/release.yml

23
.github/workflows/release.yml

@ -19,15 +19,15 @@ jobs: @@ -19,15 +19,15 @@ jobs:
name: Setup
runs-on: ubuntu-20.04
outputs:
release_version: ${{ steps.version.outputs.package }}
release_version: ${{ steps.version.outputs.version }}
branch-name: ${{ steps.branch.outputs.branch-name }}
steps:
- name: Branch check
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
run: |
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then
echo "==================================="
echo "[!] Can only release from the 'rc' or 'hotfix' branches"
echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches"
echo "==================================="
exit 1
fi
@ -36,18 +36,11 @@ jobs: @@ -36,18 +36,11 @@ jobs:
- name: Check Release Version
id: version
run: |
version=$( grep -o "<Version>.*</Version>" ./src/KeyConnector/KeyConnector.csproj | \
grep -o "[0-9]*\.[0-9]*\.[0-9]*")
previous_release_tag_version=$(
curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r ".tag_name"
)
if [ "v$version" == "$previous_release_tag_version" ] && \
[ "${{ github.event.inputs.release_type }}" == "Initial Release" ]; then
echo "[!] Already released v$version. Please bump version to continue"
exit 1
fi
echo "::set-output name=package::$version"
uses: bitwarden/gh-actions/release-version-check@8f055ef543c7433c967a1b9b04a0f230923233bb
with:
release-type: ${{ github.event.inputs.release_type }}
project-type: dotnet
file: src/KeyConnector/KeyConnector.csproj
- name: Get branch name
id: branch

Loading…
Cancel
Save