Skip to content

Commit

Permalink
Try to fix publish.yml by complementing missing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowee committed May 18, 2020
1 parent df78ce8 commit 3064ada
Showing 1 changed file with 52 additions and 46 deletions.
98 changes: 52 additions & 46 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3064ada

Please sign in to comment.