From dc7f715acddf0bd0601c7570db136931363094f2 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 16 Apr 2021 15:03:38 +0800 Subject: [PATCH] make CI create tags --- .github/workflows/main.yml | 10 +++++----- .github/workflows/release.yml | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e316c291a..617b66b28 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,14 +8,14 @@ on: jobs: setup: - runs-on: ubuntu-latest - steps: + # runs-on: ubuntu-latest + # steps: - - name: Startup - run: echo "No action setup currently needed, skipping..." + # - name: Startup + # run: echo "No action setup currently needed, skipping..." build: - needs: setup + # needs: setup runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e00447ad9..8841feee4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,15 @@ name: Make Release on: # Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on. - workflow_dispatch: - inputs: + # workflow_dispatch: + # inputs: + + # Only want to be run if a new tag starting with v is pushed. + push: + branches: + - "!*" + tags: + - "v*" jobs: build: @@ -14,6 +21,14 @@ jobs: with: submodules: 'recursive' + # get github branch and tag names as ${{ steps.branch_name.outputs.SOURCE_TAG }} + - name: Branch name + id: branch_name + run: | + echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} + echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} + echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: Setup Python uses: actions/setup-python@v2 with: @@ -47,7 +62,7 @@ jobs: draft: true prerelease: true release_name: ${{ steps.version.outputs.version }} alpha - tag_name: ${{ steps.version.outputs.version }} + tag_name: ${{ steps.branch_name.outputs.SOURCE_TAG }} # was ${{ github.ref }} body: | Autogenerated by github action, developer should edit as required before publishing...