ci: bump machine station prerelease version #87
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: NPM Prerelease | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| publish-sdk-prerelease: | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, 'ci: bump')" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.PAT }} | |
| - name: Get changed files for SDK | |
| id: changed-sdk-files | |
| uses: tj-actions/changed-files@v41 | |
| with: | |
| path: packages/sdk | |
| - name: Set up Node.js | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Configure Git | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Install dependencies | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: npm install | |
| - name: Build SDK | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: npm run build --workspace=@peaq-network/sdk | |
| - name: Bump SDK Prerelease Version | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: npm version prerelease --git-tag-version=false --workspace=@peaq-network/sdk | |
| - name: Commit and Push SDK Version Bump | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: | | |
| git add packages/sdk/package.json | |
| git commit -m "ci: bump sdk prerelease version" | |
| git push https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }} HEAD:${{ github.ref }} | |
| sleep 5 | |
| - name: Publish SDK Prerelease | |
| if: steps.changed-sdk-files.outputs.any_changed == 'false' | |
| run: npm publish --workspace=@peaq-network/sdk --tag next | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| publish-machine-station-prerelease: | |
| runs-on: ubuntu-latest | |
| needs: publish-sdk-prerelease | |
| if: "!contains(github.event.head_commit.message, 'ci: bump')" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.PAT }} | |
| - name: Get changed files for Machine Station | |
| id: changed-ms-files | |
| uses: tj-actions/changed-files@v41 | |
| with: | |
| path: packages/msf | |
| - name: Set up Node.js | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Configure Git | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Install dependencies | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: npm install | |
| - name: Build Machine Station | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: npm run build --workspace=@peaq-network/msf | |
| - name: Bump Machine Station Prerelease Version | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: npm version prerelease --git-tag-version=false --workspace=@peaq-network/msf | |
| - name: Commit and Push Machine Station Version Bump | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: | | |
| git add packages/msf/package.json | |
| git commit -m "ci: bump machine station prerelease version" | |
| git stash | |
| git pull --rebase | |
| git stash pop | |
| git push https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }} HEAD:${{ github.ref }} | |
| - name: Publish Machine Station Prerelease | |
| if: steps.changed-ms-files.outputs.any_changed == 'false' | |
| run: npm publish --workspace=@peaq-network/msf --tag next | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |