-
Notifications
You must be signed in to change notification settings - Fork 86
140 lines (132 loc) · 4.88 KB
/
updateversiondb.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
name: Update Version DB
on:
workflow_dispatch:
concurrency:
group: versiondbupdate
cancel-in-progress: true
jobs:
update-versiondb:
runs-on: ubuntu-latest
outputs:
versionDbIsUpdated: ${{ steps.runjuliascript.outputs.versionDbIsUpdated }}
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: 1.8
- id: runjuliascript
name: Update Version DB
run: |
julia scripts/versiondb/updateversiondb.jl scriptoutputfolder >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: scriptoutput
path: scriptoutputfolder
upload_versiondb:
needs: [update-versiondb]
environment: dev-channel
runs-on: ubuntu-latest
if: needs.update-versiondb.outputs.versionDbIsUpdated == 'true'
steps:
- uses: actions/checkout@v4
- name: Download script output
uses: actions/download-artifact@v4
with:
name: scriptoutput
path: scriptoutputfolder
- name: Upload version db
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control public,max-age=2678400 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'scriptoutputfolder/newversiondbs'
- name: Upload version file
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control public,max-age=0 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'scriptoutputfolder/versionfile'
- run: |
mv scriptoutputfolder/versiondbbuild/* versiondb
rm -rf scriptoutputfolder
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update version db
title: '[AUTO] Update version db'
body: >-
The version database has updated, this PR incorporates these changes.
Please note: CI will not automatically run on this PR.
To trigger CI, please close and re-open this PR.
cc: @${{ github.actor }}
labels: no changelog
upload_versiondb_dev_channel:
needs: [upload_versiondb]
environment: dev-channel
runs-on: ubuntu-latest
steps:
- name: Download script output
uses: actions/download-artifact@v4
with:
name: scriptoutput
path: scriptoutputfolder
- run: |
mv scriptoutputfolder/versionfile/DBVERSION scriptoutputfolder/versionfile/DEVCHANNELDBVERSION
- name: Upload version file
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control public,max-age=0 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'scriptoutputfolder/versionfile'
upload_versiondb_releasepreview_channel:
needs: [upload_versiondb]
environment: release-preview-channel
runs-on: ubuntu-latest
steps:
- name: Download script output
uses: actions/download-artifact@v4
with:
name: scriptoutput
path: scriptoutputfolder
- run: |
mv scriptoutputfolder/versionfile/DBVERSION scriptoutputfolder/versionfile/RELEASEPREVIEWCHANNELDBVERSION
- name: Upload version file
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control public,max-age=0 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'scriptoutputfolder/versionfile'
upload_versiondb_release_channel:
needs: [upload_versiondb]
environment: release-channel
runs-on: ubuntu-latest
steps:
- name: Download script output
uses: actions/download-artifact@v4
with:
name: scriptoutput
path: scriptoutputfolder
- run: |
mv scriptoutputfolder/versionfile/DBVERSION scriptoutputfolder/versionfile/RELEASECHANNELDBVERSION
- name: Upload version file
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --cache-control public,max-age=0 --metadata-directive REPLACE
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'scriptoutputfolder/versionfile'