update generate.yml #15
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 | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: | | |
npm ci | |
npm run build | |
# check if the last release is the same as the current version | |
lastVersion=$(npm show @rage-against-the-pixel/app-store-connect-api version) | |
version=$(node -p "require('./package.json').version") | |
if [ "$version" = "$lastVersion" ]; then | |
echo "No changes detected" | |
exit 0 | |
fi | |
npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |