-
Notifications
You must be signed in to change notification settings - Fork 27
220 lines (191 loc) · 7.71 KB
/
tag.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: tag
on:
push:
tags:
- '*'
# Environment variables available to all jobs and steps in this workflow
env:
COMPOSER_MEMORY_LIMIT: -1
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- name: Export github reference var
run: echo "GITHUB_REFERENCE=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
- name: Setup dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "drupalwxt-svc"
git clone --branch 10.3.x https://drupalwxt-svc:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/drupalwxt/site-wxt.git
cd site-wxt
rm composer.lock
- uses: statcan/actions/composer@master
with:
args: require drupalwxt/wxt:${{ env.GITHUB_REFERENCE }} --working-dir=./site-wxt
- name: Build out the Drupal infrastructure
run: |
export DB_TYPE=mysql
export DB_PORT=3306
cd site-wxt
git clone --branch 10.3.x https://github.com/drupalwxt/docker-scaffold.git docker
make build
docker compose -f docker-compose.ci.yml up -d
docker ps -a
sleep 10
- name: Run installation and tests
run: |
export DB_TYPE=mysql
export DB_PORT=3306
cd site-wxt
make drupal_install
make drupal_migrate
# Change ownership on html/core to allow files to be copied (see drupal_cs in Makefile)
sudo chown -R $(id -u) html/core
make test
- name: Generate tarball
run: |
sudo rm -rf site-wxt
composer global require grasmash/yaml-cli
export PATH=/home/runner/.composer/vendor/bin:$PATH
./tarball.sh ${{ env.GITHUB_REFERENCE }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.GITHUB_REFERENCE }}
release_name: ${{ env.GITHUB_REFERENCE }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wxt-${{ env.GITHUB_REFERENCE }}.tar.gz
asset_name: wxt-${{ env.GITHUB_REFERENCE }}.tar.gz
asset_content_type: application/tar+gzip
- name: Checkout repos to update tags
run: |
git clone --branch 10.3.x https://drupalwxt-svc:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/drupalwxt/site-wxt.git
git clone --branch 10.3.x https://drupalwxt-svc:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/drupalwxt/wxt-project.git
git clone --branch main https://drupalwxt-svc:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/drupalwxt/helm-drupal.git
git clone --branch master https://drupalwxt-svc:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/drupalwxt/terraform-kubernetes-drupalwxt.git
- name: Update tags for site-wxt
uses: jacobtomlinson/gha-find-replace@master
with:
find: "\"drupalwxt/wxt\": \"[3-5]\\.[0-9]+\\.[0-9|x]+(-(beta|rc|dev)[0-9]?)?\""
replace: "\"drupalwxt/wxt\": \"${{ env.GITHUB_REFERENCE }}\""
exclude: ".git/**"
include: "site-wxt/**"
- name: Update tags for wxt-project
uses: jacobtomlinson/gha-find-replace@master
with:
find: "\"drupalwxt/wxt\": \"[3-5]\\.[0-9]+\\.[0-9]+(-(beta|rc)[0-9])?\""
replace: "\"drupalwxt/wxt\": \"${{ env.GITHUB_REFERENCE }}\""
exclude: ".git/**"
include: "wxt-project/**"
- name: Update tags for wxt-project
uses: jacobtomlinson/gha-find-replace@master
with:
find: "wxt-project:[3-5]\\.[0-9]+\\.[0-9]+(-(beta|rc)[0-9])?"
replace: "wxt-project:${{ env.GITHUB_REFERENCE }}"
exclude: ".git/**"
include: "wxt-project/**"
- name: Update tags for helm-drupal
uses: jacobtomlinson/gha-find-replace@master
with:
find: "appVersion: [3-5]\\.[0-9]+\\.[0-9]+(-(beta|rc)[0-9])?"
replace: "appVersion: ${{ env.GITHUB_REFERENCE }}"
exclude: ".git/**"
include: "helm-drupal/**"
- name: Update tags for helm-drupal
uses: jacobtomlinson/gha-find-replace@master
with:
find: "tag: [3-5]\\.[0-9]+\\.[0-9]+(-(beta|rc)[0-9])?"
replace: "tag: ${{ env.GITHUB_REFERENCE }}"
exclude: ".git/**"
include: "helm-drupal/**"
- name: Update tags for terraform-kubernetes-drupalwxt
uses: jacobtomlinson/gha-find-replace@master
with:
find: "tag: [3-5]\\.[0-9]+\\.[0-9]+(-(beta|rc)[0-9])?"
replace: "tag: ${{ env.GITHUB_REFERENCE }}"
exclude: ".git/**"
include: "terraform-kubernetes-drupalwxt/**"
- name: Enter the site-wxt directory
working-directory: ./site-wxt
run: |
rm composer.lock
- uses: statcan/actions/composer@master
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
with:
args: install --working-dir=./site-wxt
- name: Push to site-wxt the latest stable tag
working-directory: ./site-wxt
run: |
git add .
git commit -m "feat(composer): Update version in the composer.json file ${{ env.GITHUB_REFERENCE }}" || true
git tag ${{ env.GITHUB_REFERENCE }}
git push origin 10.3.x
git push origin ${{ env.GITHUB_REFERENCE }}
- name: Update tags for site-wxt
uses: jacobtomlinson/gha-find-replace@master
with:
find: "\"drupalwxt/wxt\": \"[3-5]\\.[0-9]+\\.[0-9|x]+(-(beta|rc|dev)[0-9]?)?\""
replace: "\"drupalwxt/wxt\": \"5.3.x-dev\""
exclude: ".git/**"
include: "site-wxt/**"
- name: Enter the site-wxt directory
working-directory: ./site-wxt
run: |
rm composer.lock
- uses: statcan/actions/composer@master
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
with:
args: install --working-dir=./site-wxt
- name: Push to site-wxt the latest build sha
working-directory: ./site-wxt
run: |
git add .
git commit -m "feat(composer): Update version in the composer.json file" || true
git push origin 10.3.x
- name: Push to wxt-project the latest tags
run: |
cd wxt-project
git add .
git commit -m "Update to latest version of WxT ${{ env.GITHUB_REFERENCE }}" || true
git tag ${{ env.GITHUB_REFERENCE }}
git push origin 10.3.x
git push origin ${{ env.GITHUB_REFERENCE }}
- name: Push to helm-drupal the latest tags
run: |
cd helm-drupal
git add .
git commit -m "Update to latest version of WxT ${{ env.GITHUB_REFERENCE }}" || true
git push origin main
- name: Push to terraform-kubernetes-drupalwxt the latest tags
run: |
cd terraform-kubernetes-drupalwxt
git add .
git commit -m "Update to latest version of WxT ${{ env.GITHUB_REFERENCE }}" || true
git push origin master
# Connect to Container registry
- uses: azure/docker-login@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Container build and push to a Container registry
- run: |
docker tag site-wxt-web:latest drupalwxt/site-wxt:${{ env.GITHUB_REFERENCE }}
docker tag site-wxt-nginx:latest drupalwxt/site-wxt:${{ env.GITHUB_REFERENCE }}-nginx
docker tag site-wxt-web:latest drupalwxt/site-wxt:latest
docker tag site-wxt-nginx:latest drupalwxt/site-wxt:latest-nginx
docker push drupalwxt/site-wxt:${{ env.GITHUB_REFERENCE }}
docker push drupalwxt/site-wxt:${{ env.GITHUB_REFERENCE }}-nginx