Skip to content

zapp sizeintent

zapp sizeintent #32

name: Publish Release
on:
push:
branches: [ release/JDF_2* ]
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
RUN_REGION: europe-west1
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Check out sources...
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
cache: 'gradle'
- name: Verify
run: ./gradlew test --no-daemon
- name: Update Parameters
run: |
NOW=$(TZ=GMT date +"%Y-%m-%d %H:%M:%SZ")
YEAR=$(TZ=GMT date +"%Y")
JDF_VERSION=${GITHUB_REF#refs/heads/release/JDF_}
VERSION=${JDF_VERSION}.${GITHUB_RUN_NUMBER}-${GITHUB_SHA:0:7}
sed -i "s|@@branch@@|${GITHUB_REF#refs/heads/}|g" *.xsd
sed -i "s|@@version@@|${VERSION}|g" *.xsd
sed -i "s|@@year@@|${YEAR}|g" *.xsd
sed -i "s|@@buildTime@@|${NOW}|g" *.xsd
echo "{ \"buildTime\": \"${NOW}\", \"version\": \"${VERSION}\", \"jdfVersion\": \"${JDF_VERSION}\" }" > version.json
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Setup GCloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ inputs.GCP_PROJECT_ID }}
- name: Copy files to GCloud Bucket
run: |
gsutil cp ./*.xsd gs://schema.cip4.org/jdfschema_2_${GITHUB_REF##*JDF_2.}/
gsutil cp ./version.json gs://schema.cip4.org/jdfschema_2_${GITHUB_REF##*JDF_2.}/
- name: Create ZIP Archive
run: zip jdfschema_2_${GITHUB_REF##*JDF_2.}.zip *.xsd version.json LICENSE.md
- name: Copy ZIP Archive to GCloud Bucket
run: gsutil cp ./*.zip gs://schema.cip4.org/
- name: Createa tar.gz Archive
run: tar -czvf jdfschema_2_${GITHUB_REF##*JDF_2.}.tar.gz *.xsd version.json LICENSE.md
- name: Copy tar.gz Archive to GCloud Bucket
run: gsutil cp ./*.tar.gz gs://schema.cip4.org/
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: xsd-artifact
path: xjdf.xsd
- name: Invalidate CDN Cache
run: |
gcloud compute url-maps invalidate-cdn-cache cip4-public-balancer --path "/jdfschema_2_${GITHUB_REF##*JDF_2.}/*"
gcloud compute url-maps invalidate-cdn-cache cip4-public-balancer --path "/jdfschema_2_${GITHUB_REF##*JDF_2.}.zip"
gcloud compute url-maps invalidate-cdn-cache cip4-public-balancer --path "/jdfschema_2_${GITHUB_REF##*JDF_2.}.tar.gz"