From 6cbd832dbe342bc0ce48e1db6b73ffad5c404962 Mon Sep 17 00:00:00 2001 From: Timo Sachsenberg Date: Thu, 22 Feb 2024 15:25:13 +0100 Subject: [PATCH 1/2] add manual contrib release step --- .github/workflows/main.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9bae8bf..18f8fe4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,8 @@ name: CI -on: [push] +on: + push: + workflow_dispatch: # This allows you to manually trigger the workflow from the GitHub UI jobs: build: @@ -66,8 +68,34 @@ jobs: rm -rf CMakeFiles find . -maxdepth 1 -type f -not -name 'contrib_build.log' -delete - #TODO switch to V2 once it is released (this is to only upload relevant folders) - - uses: actions/upload-artifact@v3 + - name: Configure Git for Tagging + if: github.event_name == 'workflow_dispatch' + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + + - name: Create and Push Tag + if: github.event_name == 'workflow_dispatch' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_NAME="release-$(date +'%Y%m%d%H%M%S')" + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV # Save the tag name to an environment variable + git tag $TAG_NAME + git push origin $TAG_NAME + + - name: Create Release + if: github.event_name == 'workflow_dispatch' + id: create_release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.TAG_NAME }} # Explicitly specify the tag name for the release + files: + ./contrib-build/contrib_build-${{runner.os}}.tar.gz + + - uses: actions/upload-artifact@v4 with: name: contrib-build-${{runner.os}} path: contrib-build From 9a6ba3923e2d943258d7c37ca2de6d91b894ca33 Mon Sep 17 00:00:00 2001 From: Timo Sachsenberg Date: Thu, 22 Feb 2024 15:50:01 +0100 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18f8fe4..6536db3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,6 +96,7 @@ jobs: ./contrib-build/contrib_build-${{runner.os}}.tar.gz - uses: actions/upload-artifact@v4 + if: github.event_name == 'workflow_dispatch' with: name: contrib-build-${{runner.os}} path: contrib-build