From a41f2a7f9782b2f7648c044c886c041e203e209a Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Fri, 8 May 2020 14:29:06 +0100 Subject: [PATCH] Improved release scripts: (#307) - Removed hard coded branch for release. - Build only master branch by default. - Validate if release contains SNAPSHOT version. --- .github/workflows/build.yml | 2 ++ .github/workflows/pre-release.yml | 6 ++++++ .github/workflows/release.yml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 358db50ef..2b93ca537 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: SmallRye Build on: push: + branches: + - master paths-ignore: - '.gitignore' - 'CODEOWNERS' diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d36d42a1c..297640d4d 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -18,6 +18,12 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} metadata-file-path: '.github/project.yml' + - name: Validate version + if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT') + run: | + echo '::error::Cannot release a SNAPSHOT version.' + exit 1 + - uses: radcortez/milestone-review-action@master name: milestone review with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e197cb11f..04460692a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: git config --global user.email "smallrye@googlegroups.com" git checkout -b release mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -s maven-settings.xml - git checkout master + git checkout ${{github.base_ref}} git rebase release mvn -B release:perform -Prelease -s maven-settings.xml git push