From 89a76aedab581c3a7543dba2a2f90b88c19ac8c3 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sat, 13 Aug 2022 22:33:51 +0200 Subject: [PATCH 1/4] don't start release names with "Release " the title of the page will otherwise read "Release Release v..." --- .github/actions/release/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index e0d5576..81916a5 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -30,7 +30,7 @@ runs: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} with: tag_name : ${{ inputs.tag }} - release_name : Release ${{ inputs.tag }} + release_name : ${{ inputs.tag }} body : '' draft : true prerelease : false From aff422a6e0c83c412d73fbfd46ca459941beece8 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sat, 13 Aug 2022 21:13:16 +0200 Subject: [PATCH 2/4] allow build or pre-release details in release tags Examples: - v1.2.3-rc.1 (release candidate 1) - v1.2.3-dev+2 (dev pre-release, build 2) --- .github/workflows/build.yml | 2 ++ .github/workflows/release.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f954ed7..175a8f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,8 @@ on: tags: - '**' - '!v[0-9]+.[0-9]+.[0-9]+' + - '!v[0-9]+.[0-9]+.[0-9]+\+*' + - '!v[0-9]+.[0-9]+.[0-9]+-*' pull_request: branches: - '**' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00c84b6..3def7de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,8 @@ on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+\+*' + - 'v[0-9]+.[0-9]+.[0-9]+-*' jobs: From 2898a762d4713c1ed05db34ad06679dd1c5f0659 Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sat, 13 Aug 2022 21:17:11 +0200 Subject: [PATCH 3/4] attach dev builds all into one release Requirements: - there exists a tag named `latest-dev` already - there exists a release on that tag --- .github/actions/build/action.yml | 6 ++- .github/workflows/build.yml | 2 + .github/workflows/dev-release.yml | 62 +++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dev-release.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 9adf5e3..0790503 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -6,6 +6,10 @@ inputs: description : 'version tag' required : false default : '' + prefix: + description : 'filename prefix' + required : false + default : '' outputs: @@ -24,7 +28,7 @@ runs: run: | VERS=${{ inputs.tag }} echo "::set-output name=version::${VERS:1}" - echo "::set-output name=filename::SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}" + echo "::set-output name=filename::${{ inputs.prefix }}SMO_Online${{ (inputs.tag != '' && format('_{0}', inputs.tag)) || '' }}" - name : Set up Docker Buildx uses : docker/setup-buildx-action@v2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 175a8f7..893e378 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,11 +5,13 @@ on: push: branches: - '**' + - '!dev' tags: - '**' - '!v[0-9]+.[0-9]+.[0-9]+' - '!v[0-9]+.[0-9]+.[0-9]+\+*' - '!v[0-9]+.[0-9]+.[0-9]+-*' + - '!latest-dev' pull_request: branches: - '**' diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml new file mode 100644 index 0000000..386dcb7 --- /dev/null +++ b/.github/workflows/dev-release.yml @@ -0,0 +1,62 @@ +name: Dev Release + + +on: + push: + branches: + - 'dev' + + +env: + TAG : 'latest-dev' + + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + + +jobs: + + build: + runs-on: ubuntu-latest + outputs: + filename: ${{ steps.build.outputs.filename }} + steps: + - + name : Checkout + uses : actions/checkout@v3 + - + name : Environment + id : env + shell : bash + run: | + echo "::set-output name=prefix::$(date +'%Y%m%d_%H%M%S_' --utc)" + - + name : Build artifacts + id : build + uses : ./.github/actions/build + with: + prefix : ${{ steps.env.outputs.prefix }} + + attach: + needs: build + runs-on: ubuntu-latest + steps: + - + name : Checkout + uses : actions/checkout@v3 + - + name : Get release info + id : release + shell : bash + run: | + url=`curl -sS --fail ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ env.TAG }} | jq .upload_url -r` + echo "::set-output name=upload_url::$url" + - + name : Attach build artifacts to release + uses : ./.github/actions/attach + with: + filename : ${{ needs.build.outputs.filename }} + upload_url : ${{ steps.release.outputs.upload_url }} + GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} From 81a0726836fa6e8c1555de1334c50051a9370e0c Mon Sep 17 00:00:00 2001 From: "Robin C. Ladiges" Date: Sat, 13 Aug 2022 22:01:38 +0200 Subject: [PATCH 4/4] move latest-dev tag --- .github/workflows/dev-release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 386dcb7..4051a44 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -60,3 +60,18 @@ jobs: filename : ${{ needs.build.outputs.filename }} upload_url : ${{ steps.release.outputs.upload_url }} GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} + + move: + needs: attach + runs-on: ubuntu-latest + steps: + - + name : Checkout + uses : actions/checkout@v3 + - + name : Move ${{ env.TAG }} tag + shell : bash + run: | + git config user.email "${{ github.actor }}@users.noreply.github.com" + git tag -f ${{ env.TAG }} + git push --force origin ${{ env.TAG }}