-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 3.39 KB
/
Copy pathrelease-publish.yml
File metadata and controls
88 lines (78 loc) · 3.39 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Release Published
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
- run: npm ci
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
access: public
bump_nr_launcher:
name: Bump nr-subflow-export in nr-launcher
needs: publish
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.GH_BOT_APP_ID }}
private-key: ${{ secrets.GH_BOT_APP_KEY }}
owner: ${{ github.repository_owner }}
repositories: nr-launcher
- name: Strip v prefix from tag
id: version
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "semver=$VERSION" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: flowfuse/nr-launcher
token: ${{ steps.generate_token.outputs.token }}
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
- name: Update @flowfuse/nr-subflow-export dependency
run: npm install @flowfuse/nr-subflow-export@^${{ steps.version.outputs.semver }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.generate_token.outputs.token }}
commit-message: "chore: bump @flowfuse/nr-subflow-export to ^${{ steps.version.outputs.semver }}"
title: "chore: bump @flowfuse/nr-subflow-export to ^${{ steps.version.outputs.semver }}"
body: |
Automated PR to update `@flowfuse/nr-subflow-export` to `^${{ steps.version.outputs.semver }}`.
Triggered by [release ${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}).
branch: chore-bump-nr-subflow-export
base: main
delete-branch: true
notify-slack:
name: Notify about release failure
needs: [publish, bump_nr_launcher]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack
uses: FlowFuse/github-actions-workflows/actions/slack_notification@slack_notification/v1
with:
bot-token: ${{ secrets.SLACK_GHBOT_TOKEN }}
mode: channel
blocks: |
[
{ "type": "header", "text": { "type": "plain_text", "text": ":x: ${{ github.workflow }} workflow failed", "emoji": true } },
{ "type": "divider" },
{ "type": "section", "text": { "type": "mrkdwn", "text": "<${{ github.server_url }}/${{ github.repository }}/actions/workflows/release-publish.yml|${{ github.workflow }}> workflow failed to complete successfully." } },
{ "type": "section", "text": { "type": "mrkdwn", "text": "*Workflow run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View>" } }
]