Enhancement/update publish workflow [TEST ONLY] #857
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
pull_request: | |
branches: | |
- 'v*.*.*' | |
- master | |
- develop | |
- beta | |
- stable | |
- enhancement/update-publish-workflow | |
jobs: | |
configure: | |
# if: github.event.pull_request.merged == true | |
name: Configure release | |
runs-on: ubuntu-latest | |
outputs: | |
version_orig: ${{ steps.set-version.outputs.version_orig }} | |
version_historic: ${{ steps.set-version.outputs.version_historic }} | |
release_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Extract branch name | |
id: extract_branch | |
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: Read and calculate version | |
id: set-version | |
run: | | |
VERSION=$(cat VERSION) | |
VERSION=$(bash ./scripts/calculate_version.sh $BRANCH_NAME $VERSION) | |
echo "Calculated version: $VERSION" | |
( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true | |
echo "VERSION_ORIG=$VERSION" >> $GITHUB_ENV | |
echo "VERSION_HISTORIC=$VERSION-historic" >> $GITHUB_ENV | |
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV | |
echo "::set-output name=version_orig::$VERSION" | |
echo "::set-output name=version_historic::$VERSION-historic" | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.set-version.outputs.version_orig }} | |
release_name: ${{ steps.set-version.outputs.version_orig }} | |
draft: false | |
prerelease: ${{ env.PRERELEASE }} | |
build: | |
needs: configure | |
uses: ./.github/workflows/setup-build-publish.yml | |
with: | |
branch_name: ${{ github.ref_name }} | |
image_version: ${{ needs.configure.outputs.version_orig }} | |
build_type: "RelWithDebInfo" | |
node_type: core | |
release_url: ${{ needs.calculate-version.outputs.release_url }} | |
use_plain_version: true | |
secrets: inherit | |
build-historic: | |
needs: configure | |
uses: ./.github/workflows/setup-build-publish.yml | |
with: | |
branch_name: ${{ github.ref_name }} | |
image_version: ${{ needs.configure.outputs.version_historic }} | |
build_type: "RelWithDebInfo" | |
node_type: historic | |
release_url: ${{ needs.configure.outputs.release_url }} | |
use_plain_version: true | |
secrets: inherit | |
functional-tests: | |
uses: ./.github/workflows/functional-tests.yml | |
name: Functional testing for orig build | |
needs: [configure, build] | |
with: | |
version: ${{ needs.configure.outputs.version_orig }} | |
secrets: inherit | |
functional-tests-historic: | |
uses: ./.github/workflows/functional-tests.yml | |
name: Functional testing for historic build | |
needs: [configure, build-historic] | |
with: | |
version: ${{ needs.configure.outputs.version_historic }} | |
secrets: inherit |