v0.1.4 #73
Workflow file for this run
This file contains hidden or 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: Release Workflow | |
| on: | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| branchAndPublishImage: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| RELEASE_TAG: ${{ github.event.release.tag_name }} | |
| GIT_USER_NAME: soloio-bot | |
| GIT_USER_EMAIL: [email protected] | |
| GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/build-ui | |
| - name: Setup Git | |
| run: | | |
| git config user.name $GIT_USER_NAME | |
| git config user.email $GIT_USER_EMAIL | |
| git config --global url."https://${GH_TOKEN}@github.com/solo-io/".insteadOf "https://github.com/solo-io/" | |
| git config --global pull.rebase false | |
| git fetch --prune | |
| - name: Create/update release branch | |
| run: | | |
| RELEASE_BRANCH=$(echo $RELEASE_TAG | sed 's|\.[0-9]*$|\.x|g') | |
| # Check if the release branch exists. | |
| if [ $(git ls-remote origin --heads $RELEASE_BRANCH | wc -l) -eq 0 ]; then | |
| # If it doesn't exist, we can create it and push to it. | |
| echo "Branch $RELEASE_BRANCH does not exist, so it will be created." | |
| git checkout -b $RELEASE_BRANCH | |
| git push --set-upstream origin $RELEASE_BRANCH | |
| else | |
| # Else, we need to update it. | |
| echo "Branch $RELEASE_BRANCH exists, so it will be updated." | |
| git checkout $RELEASE_BRANCH | |
| git pull origin main -X theirs --allow-unrelated-histories | |
| git push origin $RELEASE_BRANCH | |
| fi | |
| - name: Update version in package.json | |
| run: | | |
| RELEASE_VERSION=$(echo $RELEASE_TAG | sed 's|v||g') | |
| sed -i "s|\"version\"\:[[:space:]]*\"[0-9]*\.[0-9]*\.[0-9]*\"|\"version\"\: \"$RELEASE_VERSION\"|" ./projects/ui/package.json | |
| git add ./projects/ui/package.json || true | |
| git commit -m "Update package.json version information for $RELEASE_TAG" || true | |
| git push origin $RELEASE_BRANCH | |
| - name: Gcloud Auth | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GC_PUBLIC_GCR_SA_KEY }} | |
| project_id: solo-public | |
| create_credentials_file: true | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| version: 416.0.0 | |
| - name: Configure Docker to use GCR | |
| run: | | |
| gcloud auth configure-docker --quiet | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Build and push Docker image | |
| run: | | |
| docker buildx build --push --platform linux/amd64,linux/arm64 --progress=plain --tag gcr.io/solo-public/docs/portal-frontend:${RELEASE_TAG} --tag gcr.io/solo-public/docs/portal-frontend:latest . |