diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1d10229..af02b6f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,52 +11,58 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Test & lint - run: - yarn ci - - name: Build - run: - yarn build - - name: Create tarball - run: | - tar czf /tmp/dist.tar.gz --transform s/^dist/traceroute-map-panel/ dist/ - git archive --format=tar.gz -o /tmp/src.tar.gz --prefix=traceroute-map-panel/ ${{ github.ref }} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - # body: | - # Changes in this Release - # - First Change - # - Second Change - draft: false - prerelease: false - - name: Upload Release Asset - Dist - id: upload-release-asset-dist - uses: actions/upload-release-asset@v1 - 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: /tmp/dist.tar.gz - asset_name: dist-${{ github.ref }}.tar.gz - asset_content_type: application/tar+gzip - - name: Upload Release Asset - Src - id: upload-release-asset-src - uses: actions/upload-release-asset@v1 - 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: /tmp/src.tar.gz - asset_name: src-${{ github.ref }}.tar.gz - asset_content_type: application/tar+gzip + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '12' + - name: Init + run: + yarn install + - name: Test & lint + run: + yarn ci + - name: Build + run: + yarn build + - name: Create tarball + run: | + tar czf /tmp/dist.tar.gz --transform s/^dist/traceroute-map-panel/ dist/ + git archive --format=tar.gz -o /tmp/src.tar.gz --prefix=traceroute-map-panel/ ${{ github.ref }} + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + # body: | + # Changes in this Release + # - First Change + # - Second Change + draft: false + prerelease: false + - name: Upload Release Asset - Dist + id: upload-release-asset-dist + uses: actions/upload-release-asset@v1 + 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: /tmp/dist.tar.gz + asset_name: dist-${{ github.ref }}.tar.gz + asset_content_type: application/tar+gzip + - name: Upload Release Asset - Src + id: upload-release-asset-src + uses: actions/upload-release-asset@v1 + 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: /tmp/src.tar.gz + asset_name: src-${{ github.ref }}.tar.gz + asset_content_type: application/tar+gzip # Adapted from: https://github.com/actions/create-release # and: https://github.com/actions/upload-release-asset \ No newline at end of file