Merge pull request #10 from Woosmap/dev/userproperties #5
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 Expo plugin - NPM Repo | |
'on': | |
push: | |
branches: | |
- main | |
paths: | |
- package.json | |
workflow_dispatch: null | |
jobs: | |
package_publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org/' | |
- name: Capture plugin version | |
run: | | |
_pluginVersion=$(node -p "require('./package.json').version") | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: Update change log | |
run: | | |
touch update.md | |
echo "## ${{ env.PLUGIN_VERSION }}" > update.md | |
cat whatsnew.md >> update.md | |
echo "" >> update.md | |
cat CHANGELOG.md >> update.md | |
rm CHANGELOG.md | |
mv update.md CHANGELOG.md | |
- name: Collect dependencies | |
run: | | |
npm install | |
npm run build | |
- name: Publish | |
run: | | |
# npm run prepack | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.PLUGIN_VERSION }} | |
name: Release ${{ env.PLUGIN_VERSION }} | |
update_changelog: | |
needs: package_publish | |
if: github.triggering_actor != 'wgsadmin' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v2 | |
- name: 'Use Node.js' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Capture plugin version | |
run: | | |
_pluginVersion=$(node -p "require('./package.json').version") | |
echo "PLUGIN_VERSION=${_pluginVersion}" >> $GITHUB_ENV | |
echo "new version : ${_pluginVersion}" | |
- name: Update change log | |
run: | | |
touch update.md | |
echo "## ${{ env.PLUGIN_VERSION }}" > update.md | |
cat whatsnew.md >> update.md | |
echo "" >> update.md | |
cat CHANGELOG.md >> update.md | |
rm CHANGELOG.md | |
mv update.md CHANGELOG.md | |
- name: Config git | |
run: | | |
git config user.name "wgsadmin" | |
git config user.email "[email protected]" | |
- name: Push CHANGELOG.md | |
run: | | |
git add CHANGELOG.md | |
git commit -m "Update CHANGELOG.md after Release" | |
git push |