Upload minified files to GCS #48
Workflow file for this run
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: Upload minified files to GCS | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
type: choice | |
description: Select package | |
options: | |
- '@inworld/web-core' | |
- '@inworld/web-threejs' | |
version: | |
type: string | |
description: "The version of package to minify. The version should be the same as version in package.json. For example, 1.0.0. Otherwise, the latest version will be used." | |
required: false | |
env: | |
AUTH_SERVICE_ACCOUNT: [email protected] | |
AUTH_IDENTITY_PROVIDER: projects/678423885598/locations/global/workloadIdentityPools/github-devops-pool/providers/github-prvdr | |
TAG: '' | |
jobs: | |
minify: | |
runs-on: [self-hosted, linux, x64, kubernetes, ephemeral] | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set TAG from inputs | |
run: echo "TAG=refs/tags/${{ inputs.package }}@${{ inputs.version }}" >> $GITHUB_ENV | |
if: inputs.version != '' | |
- name: Set TAG as the latest one | |
run: echo "TAG=refs/tags/`echo $(git describe --tags --match="${{ inputs.package }}*" --abbrev=0)`" >> $GITHUB_ENV | |
if: inputs.version == '' | |
- name: Minify and upload | |
uses: ./.github/actions/upload_minified_version | |
with: | |
package: ${{ inputs.package }} | |
tag: ${{ env.TAG }} | |
env: | |
AUTH_SERVICE_ACCOUNT: ${{ env.AUTH_SERVICE_ACCOUNT }} | |
AUTH_IDENTITY_PROVIDER: ${{ env.AUTH_IDENTITY_PROVIDER }} |