generated from xiangnanscu/lua2js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0732392
commit c5bd6ce
Showing
4 changed files
with
50 additions
and
35 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Publish to NPM Packages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: "package.json" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install jq | ||
run: sudo apt-get install jq | ||
- name: Check if version changed | ||
id: version_changed | ||
run: | | ||
VERSION_OLD=$(git show ${{ github.event.before }}:package.json | jq -r .version) | ||
VERSION_NEW=$(jq -r .version package.json) | ||
if [ "$VERSION_OLD" != "$VERSION_NEW" ]; then | ||
echo "Version changed from $VERSION_OLD to $VERSION_NEW" | ||
echo "{changed}={true}" >> $GITHUB_OUTPUT | ||
else | ||
echo "Version did not change" | ||
echo "{changed}={false}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Publish to npm | ||
if: steps.version_changed.outputs.changed == 'true' | ||
run: npm i | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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