Update Version DB #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |