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