From 07a1cf63a16bb0104d911aaa191087bfadade4cd Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 10 Aug 2022 13:57:33 +0100 Subject: [PATCH] Add version support release-selfhost.yml --- .github/workflows/release-selfhost.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index b746c76bc3..b733446f73 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -2,6 +2,10 @@ name: Budibase Release Selfhost on: workflow_dispatch: + inputs: + version: + description: Budibase release version. For example - 1.0.0 + required: false env: BRANCH: ${{ github.event.pull_request.head.ref }} @@ -12,19 +16,32 @@ jobs: runs-on: ubuntu-latest steps: + - name: Fail if branch is not master + if: github.ref != 'refs/heads/master' + run: | + echo "Ref is not master, you must run this job from master." + exit 1 + - uses: actions/checkout@v2 with: node-version: 14.x fetch_depth: 0 + - name: Get the latest budibase release version + id: version + run: | + if [ -z "${{ github.event.inputs.version }}" ]; then + release_version=$(cat lerna.json | jq -r '.version') + else + release_version=${{ github.event.inputs.version }} + fi + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + - name: Tag and release Docker images (Self Host) run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD - # Get latest release version - release_version=$(cat lerna.json | jq -r '.version') - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - release_tag=v$release_version + release_tag=v${{ env.RELEASE_VERSION }} # Pull apps and worker images docker pull budibase/apps:$release_tag