Skip to content

On push to release branch #217

On push to release branch

On push to release branch #217

name: On push to release branch
on:
push:
branches: [release]
jobs:
release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release.outputs.release }}
steps:
- uses: actions/checkout@v3
- name: Set release
id: semrel
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
allow-initial-development-versions: false
force-bump-patch-version: true
# For whatever reason, this silly tool won't let you do releases from branches
# other than the default branch unless you pass this flag, which doesn't seem
# to actually have anything to do with CI:
# https://github.com/go-semantic-release/semantic-release/blob/master/cmd/semantic-release/main.go#L173-L194
# https://github.com/go-semantic-release/condition-github/blob/4c8af3fc516151423fff2f77eb08bf7082570676/pkg/condition/github.go#L42-L44
custom-arguments: '--no-ci'
- name: Output release
id: release
run: echo "release=${{ steps.semrel.outputs.version }}" >> $GITHUB_OUTPUT
publish_javascript:
# The type of runner that the job will run on
runs-on: ubuntu-24.04
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}
needs: release
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Publish all packages to npm
run: |
./scripts/publish-all-packages.sh "${{ needs.release.outputs.version }}"
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}