-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: publish npm workflow #21
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
=====================================
Coverage 9.17% 9.17%
=====================================
Files 1 1
Lines 218 218
=====================================
Hits 20 20
Misses 198 198 ☔ View full report in Codecov by Sentry. |
@zeta-chain/devops can someone, please, create a new npm package: https://www.npmjs.com/package/@zetachain/protocol-contracts-solana And add an npm token to this repo. Thanks! |
Co-authored-by: Alex Gartner <[email protected]>
.github/workflows/publish-npm.yml
Outdated
- name: Install Rust | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source $HOME/.cargo/env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
- name: Install stable
uses: dtolnay/rust-toolchain@stable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.github/workflows/publish-npm.yml
Outdated
- name: Determine NPM Tag | ||
id: determine-npm-tag | ||
run: | | ||
VERSION_TAG=${GITHUB_REF#refs/tags/v} | ||
if [[ $VERSION_TAG == *"-"* ]]; then | ||
echo ::set-output name=NPM_TAG::${VERSION_TAG#*-} | ||
else | ||
echo ::set-output name=NPM_TAG::latest | ||
fi | ||
env: | ||
GITHUB_REF: ${{ github.ref }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is deprecated by GitHub, please consider using:
steps:
- name: Set the foo value
id: foo_value
run: |
echo "foo=bar" >> "$GITHUB_ENV"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but this has never worked for me. I propose we improve this in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a working example in a workflow on this repository:
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,RUST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the versioning of the published package? |
A workflow to publish IDL files on npm. Published when a GitHub release is made.