deps: bump serve from 14.2.5 to 14.2.6 (#781) #52
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
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| name: Publish | |
| jobs: | |
| # Publish canary version on every update to main | |
| canary: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/jod | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@globus' | |
| - run: npm install -g npm@latest | |
| - run: npm ci | |
| - name: Generate Pre-Release Version | |
| id: version | |
| run: | | |
| # Get the current version from package.json | |
| CURRENT_VERSION=$(jq -r '.version' package.json) | |
| # Get the current commit count since last tag | |
| COMMIT_COUNT=$(git rev-list --count v${CURRENT_VERSION}..main) | |
| # Get the short SHA | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| # Create pre-release version | |
| PRE_VERSION="${CURRENT_VERSION}-canary.${COMMIT_COUNT}.${SHORT_SHA}" | |
| echo "version=${PRE_VERSION}" >> $GITHUB_OUTPUT | |
| echo "Pre-release version: ${PRE_VERSION}" | |
| - name: Update package.json version | |
| run: | | |
| jq '.version = "${{ steps.version.outputs.version }}"' package.json > package.json.tmp && mv package.json.tmp package.json | |
| - run: npm run build | |
| # Publish to NPM with 'canary' tag | |
| - run: npm publish --access public --tag canary | |
| # Check for a new release using release-please | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| releases_created: ${{ steps.release.outputs.releases_created }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| # Publish to NPM if a release was identified | |
| publish: | |
| needs: release-please | |
| runs-on: ubuntu-latest | |
| if: needs.release-please.outputs.releases_created == 'true' | |
| steps: | |
| # Publish to NPM | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/jod | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@globus' | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm publish --access public | |
| # - name: Notify Slack | |
| # id: slack | |
| # uses: slackapi/slack-github-action@v1.26.0 | |
| # with: | |
| # channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | |
| # payload: | | |
| # { | |
| # "blocks": [ | |
| # { | |
| # "type": "section", | |
| # "text": { | |
| # "type": "mrkdwn", | |
| # "text": "`@globus/sdk@${{ steps.release.outputs.tag_name }}` has been released!" | |
| # } | |
| # }, | |
| # { | |
| # "type": "divider" | |
| # }, | |
| # { | |
| # "type": "actions", | |
| # "elements": [ | |
| # { | |
| # "type": "button", | |
| # "text": { | |
| # "type": "plain_text", | |
| # "text": "View Release Details on GitHub", | |
| # "emoji": true | |
| # }, | |
| # "url": "${{ steps.release.outputs.html_url }}" | |
| # } | |
| # ] | |
| # } | |
| # ] | |
| # } | |
| # env: | |
| # SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |