-
-
Notifications
You must be signed in to change notification settings - Fork 54
100 lines (87 loc) · 3.01 KB
/
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
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
name: Release Please
on:
push:
branches:
- master
jobs:
change-finder:
runs-on: ubuntu-latest
name: Change Finder
outputs:
changed: ${{ steps.find.outputs.changed }}
plugins: ${{ steps.find.outputs.plugins }}
steps:
- name: Check Out
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Find
id: find
run: |
npm i @actions/core
node changeFinder.js
release-please-pr:
runs-on: ubuntu-latest
name: Release Please PR
needs:
- change-finder
- release-please-release
strategy:
fail-fast: false
matrix:
plugin: ${{ fromJson(needs.change-finder.outputs.plugins) }}
steps:
- name: Release Please PR
uses: google-github-actions/release-please-action@v3
with:
release-type: simple
package-name: ${{ matrix.plugin }}
path: ${{ matrix.plugin }}
monorepo-tags: true
command: release-pr
pull-request-title-pattern: 'chore${scope}: 🔖 release${component} ${version}'
release-please-release:
runs-on: ubuntu-latest
name: Release Please Release
needs: change-finder
if: ${{ needs.change-finder.outputs.changed == 'true' }}
strategy:
fail-fast: false
matrix:
plugin: ${{ fromJson(needs.change-finder.outputs.plugins) }}
steps:
- name: Release Please Release
uses: google-github-actions/release-please-action@v3
id: release_please_release
with:
release-type: simple
package-name: ${{ matrix.plugin }}
path: ${{ matrix.plugin }}
monorepo-tags: true
command: github-release
pull-request-title-pattern: 'chore${scope}: 🔖 release${component} ${version}'
- name: Check Out
uses: actions/checkout@v3
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
- name: Setup Python
uses: actions/setup-python@v4
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
with:
python-version: '3.10'
- name: Install Dependencies
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
run: |
python -m pip install --upgrade pip
pip install mcdreforged
- name: Pack
id: pack
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
run: |
python -m mcdreforged pack --ignore-patterns __pycache__ -i ${{ matrix.plugin }}
echo "name=$(ls *.mcdr)" >> $GITHUB_OUTPUT
- name: Upload
if: ${{ steps.release_please_release.outputs[format('{0}--release_created', matrix.plugin)] }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ steps.release_please_release.outputs[format('{0}--tag_name', matrix.plugin)] }} ${{ steps.pack.outputs.name }}