Release 2.2.4 #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish-release | |
on: | |
release: | |
types: [ released ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install | |
- run: npm run build | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Pack tarball | |
id: pack_tarball | |
run: | | |
PACK_NAME=$(npm pack | tail -n 1) | |
echo "::set-output name=tar_filename::$PACK_NAME" | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: package | |
path: "*.tgz" | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload asset to github release page | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./${{ steps.pack_tarball.outputs.tar_filename }} | |
asset_name: ${{ steps.pack_tarball.outputs.tar_filename }} | |
asset_content_type: application/gzip |