-
-
Notifications
You must be signed in to change notification settings - Fork 11
107 lines (98 loc) · 3.54 KB
/
release-please-beta.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
on:
workflow_dispatch:
push:
branches:
- "beta"
env:
PLUGIN_NAME: calendarium
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_BOT_NAME: "GitHub Action"
permissions:
contents: write
pull-requests: write
name: Beta
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
upload_url: ${{ steps.release.outputs.upload_url }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config-beta.json
manifest-file: .release-please-manifest-beta.json
target-branch: beta
build:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}
env:
upload_url: ${{ needs.release.outputs.upload_url }}
tag_name: ${{ needs.release.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
- name: Build
id: build
run: |
npm install
npm run build --if-present
mkdir ${{ env.PLUGIN_NAME }}
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
- name: Upload Release Artifact
if: ${{ needs.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release.outputs.tag_name }} \
'./${{ env.PLUGIN_NAME }}.zip' \
'./main.js' \
'./styles.css' \
'./manifest.json'
beta:
runs-on: ubuntu-latest
needs: [build, release]
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Update Beta Manifest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name ${{ env.GH_BOT_NAME }}
git config user.email ${{ env.GH_BOT_EMAIL }}
sed 's|\(version":\) ".*"|\1 "'${{ needs.release.outputs.tag_name }}'"|' manifest.json > manifest-beta.json
cat manifest-beta.json
git add manifest-beta.json
git status
git commit -m "🔖 ${{ needs.release.outputs.tag_name }}"
git push --force
notify:
runs-on: ubuntu-latest
needs: build
if: false
steps:
- name: Obsidian
uses: javalent/workflows/actions/discord-embed@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Calendarium
webhook-urls: ${{ secrets.OBSIDIAN_WEBHOOK }}
beta: true
- name: TTRPG
uses: javalent/workflows/actions/discord-embed@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Calendarium
webhook-urls: ${{ secrets.TTRPG_WEBHOOK }}
beta: true