From d90b4c17214d23f5d4cabb0e4cbf84b3518860f4 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 31 Aug 2022 17:21:16 +0800 Subject: [PATCH 1/2] Automaticlly retag for the new release #92 --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..b3ad2fb3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + release: + branches: [main] + types: [published] + workflow_dispatch: + inputs: + tag: + description: 'which tag to update to' + default: 'v2' + required: true + ref: + description: 'which branch, tag or SHA to update the tag on' + default: 'main' + required: true + +permissions: + contents: read + +jobs: + re-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ inputs.ref }} + - name: update tag + run: | + git config user.name 'github-actions' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git tag --delete ${{ inputs.tag }} || true + git push --delete origin ${{ inputs.tag }} || true + git tag -a latest -m 'Retag ${{ inputs.tag }}' + git push origin ${{ inputs.tag }} From d249508a7c8ab3623079094b3667534807cf6c7e Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Thu, 1 Sep 2022 13:48:13 +0800 Subject: [PATCH 2/2] Fix running failure issue --- .github/workflows/release.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b3ad2fb3..e86569e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,13 +11,10 @@ on: default: 'v2' required: true ref: - description: 'which branch, tag or SHA to update the tag on' + description: 'which branch to update the tag on' default: 'main' required: true -permissions: - contents: read - jobs: re-tag: runs-on: ubuntu-latest @@ -32,5 +29,5 @@ jobs: git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git tag --delete ${{ inputs.tag }} || true git push --delete origin ${{ inputs.tag }} || true - git tag -a latest -m 'Retag ${{ inputs.tag }}' + git tag -a ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}' git push origin ${{ inputs.tag }}