From 859b3988f7200b411d3a0ba1d07d6c10cf22413d Mon Sep 17 00:00:00 2001 From: Jon Smock Date: Thu, 21 Nov 2024 18:12:54 +0000 Subject: [PATCH] WIP Release jobs --- .github/workflows/push.yaml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 7e77ed7..4a29c31 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -53,3 +53,51 @@ jobs: env: DCTEST_IMAGE: dctest run: ./test/runexamples + + # Decide if a release is necessary, perform release checks + check-release: + needs: [ test-node, test-docker ] + name: Check Release + runs-on: ubuntu-latest + # TODO: + #if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '.') + outputs: + RELEASE_VERSION: ${{ steps.get-version.outputs.RELEASE_VERSION }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: { submodules: 'recursive', fetch-depth: 0 } + + - id: get-version + name: Get release version + run: | + echo "RELEASE_VERSION=$(jq -r .version package.json)" | tee "$GITHUB_ENV" | tee "$GITHUB_OUTPUT" + + - name: Check git tag matches release version + run: | + [ "refs/heads/release-workflow" == "${{ github.ref }}" ] + # TODO [ "refs/tags/${RELEASE_VERSION}" == "${{ github.ref }}" ] + + release-npm: + needs: [ check-release ] + name: Release NPM + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: { submodules: 'recursive', fetch-depth: 0 } + + release-docker-hub: + needs: [ check-release ] + name: Release Docker Hub + runs-on: ubuntu-latest + env: + RELEASE_VERSION: ${{ needs.check-release.outputs.RELEASE_VERSION }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: { submodules: 'recursive', fetch-depth: 0 } + + - name: Check version + run: | + echo "Should release ${RELEASE_VERSION}"