-
Notifications
You must be signed in to change notification settings - Fork 4
129 lines (122 loc) · 4.84 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Plugin Release
on:
push:
branches:
- master
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
accessibility-branch: ${{ github.ref }}
get-version:
name: Get version info
uses: ./.github/workflows/get-version.yml
push-branches:
name: Push to release branches
needs: [ci, get-version]
outputs:
release: ${{ needs.get-version.outputs.plugin-release }}
version: ${{ needs.get-version.outputs.plugin-version }}
branch-no-widgets: ${{ needs.get-version.outputs.branch-name }}
branch-with-widgets: ${{ needs.get-version.outputs.branch-name }}-with-widgets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Push to release branch (without default widgets)
run: |
git checkout -b ${{ needs.get-version.outputs.branch-name }}
git push -f -u origin ${{ needs.get-version.outputs.branch-name }}
- name: Remove .gitignore for default widgets pack
run: |
git config --global user.name "ponlawat-w"
git config --global user.email "[email protected]"
git checkout -b ${{ needs.get-version.outputs.branch-name }}-with-widgets
rm ./.gitignore
git add -A
git commit -m 'Removed .gitignore'
- name: 'Checkout Widget: backgroundcolour'
uses: actions/checkout@v4
with:
repository: ponlawat-w/moodle-accessibility_backgroundcolour
path: widgets/backgroundcolour
ref: ${{ needs.ci.outputs.widget-backgroundcolour-branch }}
- name: 'Checkout Widget: fontface'
uses: actions/checkout@v4
with:
repository: ponlawat-w/moodle-accessibility_fontface
path: widgets/fontface
ref: ${{ needs.ci.outputs.widget-fontface-branch }}
- name: 'Checkout Widget: fontsize'
uses: actions/checkout@v4
with:
repository: ponlawat-w/moodle-accessibility_fontsize
path: widgets/fontsize
ref: ${{ needs.ci.outputs.widget-fontsize-branch }}
- name: 'Checkout Widget: textcolour'
uses: actions/checkout@v4
with:
repository: ponlawat-w/moodle-accessibility_textcolour
path: widgets/textcolour
ref: ${{ needs.ci.outputs.widget-textcolour-branch }}
- name: Add widgets
run: |
rm -rf widgets/backgroundcolour/.git
rm -rf widgets/backgroundcolour/.github
rm -rf widgets/fontface/.git
rm -rf widgets/fontface/.github
rm -rf widgets/fontsize/.git
rm -rf widgets/fontsize/.github
rm -rf widgets/textcolour/.git
rm -rf widgets/textcolour/.github
git add -A
git commit -m 'Added default widgets'
git push -f -u origin ${{ needs.get-version.outputs.branch-name }}-with-widgets
release:
needs: push-branches
strategy:
fail-fast: true
matrix:
include:
- branch: ${{ needs.push-branches.outputs.branch-no-widgets }}
name: v${{ needs.push-branches.outputs.release }}-no-widgets
body: ${{ needs.push-branches.outputs.release }} - ${{ needs.push-branches.outputs.version }} with no widgets
delete-branch: false
- branch: ${{ needs.push-branches.outputs.branch-with-widgets }}
name: v${{ needs.push-branches.outputs.release }}-with-widgets
body: ${{ needs.push-branches.outputs.release }} - ${{ needs.push-branches.outputs.version }} with default widgets
delete-branch: true
name: Release ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Publish Tag
run: |
git config --global user.name "ponlawat-w"
git config --global user.email "[email protected]"
git tag -fa ${{ matrix.name }} -m "${{ matrix.body }}"
git push --force origin ${{ matrix.name }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ matrix.name }}
name: ${{ matrix.name }}
body: ${{ matrix.body }}
- name: Delete branch
if: ${{ matrix.delete-branch }}
run: git push --force -d origin ${{ matrix.branch }}
make-latest-version:
name: Make latest version
needs: [push-branches, release]
runs-on: ubuntu-latest
steps:
- name: Make latest version
run: gh release edit --repo ponlawat-w/moodle-local_accessibility v${{ needs.push-branches.outputs.release }}-with-widgets --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}