From 4b3a8c625020f15b53b96f7628d98d7385f90afe Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Tue, 7 May 2024 11:39:02 +0200 Subject: [PATCH] Add workflow_dispatch to the release workflow in GHA --- .github/workflows/tag-release.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000..41f6c0e --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,51 @@ +name: tag-release +on: + push: + tags: + - "*.*.*" + workflow_dispatch: + +jobs: + build: + permissions: + contents: write + + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + COMPONENT_NAME: OpenConext-user-lifecycle + if: always() + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: OpenConext/Stepup-Build + - name: Output the semver tag to the tag variable + id: vars + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + - name: Run release script + run: ./stepup-build.sh ${COMPONENT_NAME} --tag ${{ steps.vars.outputs.tag }} + - name: Grab the archive filename + id: archive + run: | + echo "archive=$(find . -maxdepth 1 -name "$COMPONENT_NAME*.tar.bz2" -printf '%f\n')" >> $GITHUB_OUTPUT + echo "shasum=$(find . -maxdepth 1 -name "$COMPONENT_NAME*.sha" -printf '%f\n')" >> $GITHUB_OUTPUT + + - name: Release + uses: softprops/action-gh-release@v2 + with: + files: | + ${{ steps.archive.outputs.archive }} + ${{ steps.archive.outputs.shasum }} + token: ${{ secrets.GITHUB_TOKEN }} + fail_on_unmatched_files: true + generate_release_notes: true + + after_build: + needs: build + runs-on: ubuntu-latest + steps: + - name: Trigger Docker container build + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: build-push-docker-image.yml