generated from saleor/saleor-app-payment-template
-
Notifications
You must be signed in to change notification settings - Fork 177
70 lines (58 loc) · 2.25 KB
/
prepare-release.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: Open release
on:
push:
branches:
- canary
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Prepare release with Changesets
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
# Tags are fetched for Changeset to distinguish from new ones while running `changeset tag`
- name: Git fetch tags
run: git fetch --tags origin
- uses: pnpm/action-setup@v2
with:
version: 8.12.0
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: "pnpm"
- name: Install dependencies
run: pnpm --version && pnpm install --frozen-lockfile
- name: Create Release Pull Request
uses: changesets/action@v1
id: changesets
with:
title: Release Stripe App
commit: Release Stripe App
publish: pnpm github:release
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Open PR to main
if: steps.changesets.outputs.hasChangesets == 'false' && steps.changesets.outputs.published == 'true'
id: open-pr
uses: repo-sync/pull-request@v2
with:
destination_branch: "main"
pr_title: "[Automated] Release ${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}"
pr_body: "Changelog: https://github.com/saleor/saleor-app-payment-stripe/releases/tag/v${{ fromJson(steps.changesets.outputs.publishedPackages)[0].version }}"
- name: Approve PR to main
if: steps.changesets.outputs.hasChangesets == 'false' && steps.changesets.outputs.published == 'true'
uses: hmarr/auto-approve-action@v3
with:
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}
github-token: ${{ secrets.PAT }}
- name: Merge PR to main
if: steps.changesets.outputs.hasChangesets == 'false' && steps.changesets.outputs.published == 'true'
run: gh pr merge --squash --auto ${{ steps.open-pr.outputs.pr_number }}
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: print outputs
if: always()
run: "echo '${{toJSON(steps.changesets)}}}'"