Skip to content

Add Segment track calls to code copy button (#178) #41

Add Segment track calls to code copy button (#178)

Add Segment track calls to code copy button (#178) #41

name: Release UI Bundle
concurrency:
group: docs-ui-release-bundle
on:
push:
branches:
- 'main'
jobs:
bundle-release:
runs-on: ubuntu-latest
steps:
- name: Configure Git Credentials
uses: de-vri-es/setup-git-credentials@v2
with:
credentials: https://${{ secrets.DOCS_GITHUB_PAT }}@github.com
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch tags too
- name: Check Last Commit Message
id: skip_release
run: |
last_commit_message=$(git log -1 --pretty=%B)
if [[ $last_commit_message == *"[no-release]"* ]]; then
echo "Last commit message contains [no-release]. Skipping workflow."
echo "skip_release=1" >> $GITHUB_OUTPUT
fi
- name: Setup Node.js
if: ${{ steps.skip_release.outputs.skip_release == '' }}
uses: actions/setup-node@v4
with:
node-version: 21.6.1
- name: Install Dependencies
if: ${{ steps.skip_release.outputs.skip_release == '' }}
run: npm ci
- name: Build UI Bundle
if: ${{ steps.skip_release.outputs.skip_release == '' }}
run: |
set -o pipefail
gulp bundle |& tee $GITHUB_WORKSPACE/build.log
- name: Get Last Release Number
id: get_last_release_number
if: ${{ steps.skip_release.outputs.skip_release == '' }}
run: |
# Get the latest tag by release integer (tag with the highest prod-[number]; not most recently created tag)
last_release_number=$(git tag --sort=-creatordate | grep prod | awk -F '-' '{ print $2 }' | sort -nr | head -n 1)
echo "number=$last_release_number" >> $GITHUB_OUTPUT
- name: Increment Release Number
id: increment_tag
if: ${{ steps.skip_release.outputs.skip_release == '' }}
run: |
last_tag_integer=${{ steps.get_last_release_number.outputs.number }}
next_tag_integer=$((last_tag_integer + 1))
next_tag="prod-$next_tag_integer"
echo "next_tag=$next_tag" >> $GITHUB_OUTPUT
- name: Create Release
if: ${{ steps.skip_release.outputs.skip_release == '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.increment_tag.outputs.next_tag }}
last_tag_number: ${{ steps.get_last_release_number.outputs.number }}
run: |
gh release create "$tag" build/ui-bundle.zip \
--repo="$GITHUB_REPOSITORY" \
--title=$tag \
--target=${{ github.sha }} \
--generate-notes \
--notes-start-tag "prod-$last_tag_number"