Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

chore: publish using npm_publish_automation #306

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ jobs:
registry-url: "https://registry.npmjs.org"
- name: Build NPM Package
run: deno task dnt ${{steps.get_tag_version.outputs.TAG_VERSION}}
- name: Publish NPM Package
- run: npm pack
working-directory: "./target/npm"
- uses: actions/upload-artifact@v3
with:
name: package
path: "./target/npm/*.tgz"
- uses: octokit/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
route: POST /repos/paritytech/npm_publish_automation/actions/workflows/publish.yml/dispatches
ref: main
inputs: '${{ format(''{{ "repo": "{0}", "run_id": "{1}" }}'', github.repository, github.run_id) }}'
Comment on lines +34 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be easier to use the gh cli

echo '{...}' | gh workflow run -R paritytech/npm_publish_automation ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, but this is tested and working, so I'm inclined to leave it as is

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd target/npm && npm publish
GITHUB_TOKEN: ${{ secrets.NPM_PUBLISH_AUTOMATION_TOKEN }}