Publish next #360
This file contains hidden or 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 next' | ||
| on: | ||
| workflow_run: | ||
| workflows: | ||
| - 'CI' | ||
| types: | ||
| - completed | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| permissions: | ||
| id-token: write | ||
| jobs: | ||
| build: | ||
| name: Build & Release | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success') && ${{ startsWith(github.repository, 'eclipse-daanse/') && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }} | ||
|
Check warning on line 18 in .github/workflows/push_next.yml
|
||
| env: | ||
| changes: true | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | ||
| with: | ||
| # To fetch all history for all branches and tags. | ||
| # Required for lerna to determine the version of the next package. | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.workflow_run.head_commit.id || github.sha }} | ||
| - name: Check for changes in "packages" directory | ||
| id: check_changes | ||
| run: | | ||
| if git diff --name-only HEAD^ HEAD | grep -qE '^packages'; then | ||
| echo "changes=true" >> $GITHUB_ENV | ||
| else | ||
| echo "changes=false" >> $GITHUB_ENV | ||
| fi | ||
| if: github.event_name == 'workflow_run' | ||
| - uses: actions/setup-node@v6.3.0 | ||
| with: | ||
| node-version: 20.x | ||
| registry-url: 'https://registry.npmjs.org' | ||
| if: env.changes == 'true' | ||
| - uses: actions/setup-python@v6.2.0 | ||
| with: | ||
| python-version: '3.11' | ||
| if: env.changes == 'true' | ||
| - name: Publish NPM | ||
| run: lerna publish from-package --dist-tag next -y | ||
| env: | ||
| NPM_CONFIG_PROVENANCE: 'true' | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | ||
| if: env.changes == 'true' | ||