From ad5ea8e9513584fdf897ad089efdccabb3a76e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Fri, 11 Jun 2021 11:44:43 +0200 Subject: [PATCH] [CI] Create github release automatically Apparently it is the way to go Change-Id: I3d443138e7d6ea4e9b190e8f120ae71e7e346cc8 --- .github/workflows/publish.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b4444faf..1fcffa34 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,5 @@ name: PostSubmit -on: - release: - types: [published] +on: push jobs: publish: name: Publish @@ -21,19 +19,19 @@ jobs: run: npm run dist - name: Get the version id: get_version + if: startsWith(github.ref, 'refs/tags/') run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} - name: prepare deploy + if: startsWith(github.ref, 'refs/tags/') run: cd dist && zip -r marathon-ui-${TAG}.zip . env: TAG: ${{ steps.get_version.outputs.TAG }} - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 + - name: Create release + id: upload-release-asset + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: dist/marathon-ui-${{ steps.get_version.outputs.TAG }}.zip - asset_name: marathon-ui-${{ steps.get_version.outputs.TAG }}.zip - asset_content_type: application/zip + files: dist/marathon-ui-${{ steps.get_version.outputs.TAG }}.zip