Skip to content

publish-canary

publish-canary #78

name: publish-canary
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to create a canary from'
required: true
env:
PROPELDATA_CI_TOKEN: ${{ secrets.PROPELDATA_CI_TOKEN }}
jobs:
publish:
if: github.event.head_commit.message != 'release'
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v3
with:
# so that when we push tags, workflows are released, which does not happen with the default token
token: ${{ secrets.PROPELDATA_CI_TOKEN }}
# NOTE(mroberts): https://github.com/actions/checkout/issues/217
fetch-depth: '0'
ref: ${{ github.event.inputs.branch }}
- uses: actions/checkout@v3
with:
repository: propeldata/actions
token: ${{ secrets.PROPELDATA_CI_TOKEN }}
path: actions
- uses: ./actions/propel-slack
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_signing_secret: ${{ secrets.SLACK_SIGNING_SECRET }}
message_type: 'pipeline'
- uses: ./actions/propel-slack
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_signing_secret: ${{ secrets.SLACK_SIGNING_SECRET }}
message_type: 'publish'
# Build
- uses: actions/setup-node@v3
with:
node-version: '18.13.0'
- uses: ./actions/propel-slack
with:
slack_token: ${{ secrets.SLACK_TOKEN }}
slack_signing_secret: ${{ secrets.SLACK_SIGNING_SECRET }}
message_type: 'build'
- uses: ./.github/actions/prepare
with:
cache_fresh_start: 'true'
# Release
- name: Prerelease Version and Publish
id: changesets
run: |
yarn config set -H 'npmAuthToken' "${{secrets.NPM_TOKEN}}"
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
yarn changeset version --snapshot canary
yarn changeset publish --tag canary --no-git-tag
env:
GITHUB_TOKEN: ${{ secrets.PROPELDATA_CI_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}