From e3f58442aac389f5bbb5df8520c740498206eda1 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 16 Oct 2023 22:19:52 +0800 Subject: [PATCH] Move release creation to prodtag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a limitation of workflow: An action in a workflow run can’t trigger a new workflow run. https://github.com/orgs/community/discussions/27028#discussioncomment-3254360 --- .github/workflows/prodtag.yml | 13 ++++++++++++- .github/workflows/tagrelease.yml | 26 -------------------------- 2 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/tagrelease.yml diff --git a/.github/workflows/prodtag.yml b/.github/workflows/prodtag.yml index 802af59..0df41be 100644 --- a/.github/workflows/prodtag.yml +++ b/.github/workflows/prodtag.yml @@ -1,4 +1,4 @@ -name: Auto-create tag on every push to `production` +name: Auto-create tag/release on every push to `production` on: push: @@ -8,9 +8,20 @@ on: jobs: tag: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 with: ref: production - run: git tag "`date +%Y.%m.%d`.`git rev-parse --short HEAD`" $(git rev-parse HEAD) - run: git push --tags + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci && npm run build + - run: cd dist && zip -r ../phanpy-dist.zip . && cd .. + - uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + files: phanpy-dist.zip diff --git a/.github/workflows/tagrelease.yml b/.github/workflows/tagrelease.yml deleted file mode 100644 index 30198a2..0000000 --- a/.github/workflows/tagrelease.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Create Release on every tag push in `production` - -on: - push: - tags: - - '*' - workflow_dispatch: - -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - ref: production - - uses: actions/setup-node@v3 - with: - node-version: 18 - - run: npm ci && npm run build - - run: cd dist && zip -r ../phanpy-dist.zip . && cd .. - - uses: softprops/action-gh-release@v1 - with: - generate_release_notes: true - files: phanpy-dist.zip