forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.14 KB
/
publish-canary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: 🦜 Publish Canary
on:
push:
branches: [main, next]
# We don't want this to run when we publish a release.
tags-ignore: ['v**']
# No need to run on docs-only changes
paths-ignore: ['docs/**']
# Cancel in-progress runs of this workflow.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
publish-canary:
name: 🦜 Publish Canary
if: github.repository == 'redwoodjs/redwood'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.value }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# `fetch-depth`—number of commits to fetch. `0` fetches all history for all branches and tags.
# This is required because lerna uses tags to determine the version.
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Set up job
uses: ./.github/actions/set-up-job
- name: 🔎 Lint
run: yarn lint
- name: 🧪 Test
run: yarn test
- name: 🚢 Publish
run: ./.github/scripts/publish_canary.sh
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: 🏷 Get version
id: get-version
uses: sergeysova/jq-action@a3f0d4ff59cc1dddf023fc0b325dd75b10deec58 # v2.3.0
with:
cmd: 'jq .version packages/core/package.json -r'
message-slack:
name: 💬 Message Slack
needs: publish-canary
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: 💬 Message Slack
uses: ./.github/actions/message_slack_publishing
with:
title: '🦜 Canary Packages'
status: ${{ needs.publish-canary.result }}
version: ${{ needs.publish-canary.outputs.version }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_PACKAGE_PUBLISHING }}