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