fix: Fix invalid valueExpression (#1161) #442
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 | |
on: | |
push: | |
branches: [main] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: write | |
packages: write | |
pull-requests: write | |
jobs: | |
check_changesets: | |
name: Check Changesets | |
runs-on: ubuntu-24.04 | |
outputs: | |
changeset_outputs_hasChangesets: | |
${{ steps.changesets.outputs.hasChangesets }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache-dependency-path: 'yarn.lock' | |
cache: 'yarn' | |
- name: Install root dependencies | |
run: yarn install | |
- name: Create Release Pull Request or Publish to npm | |
if: always() | |
continue-on-error: true | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
commit: 'chore(release): bump HyperDX app/package versions' | |
title: 'Release HyperDX' | |
version: yarn run version | |
publish: yarn release | |
env: | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
release: | |
name: Release | |
needs: check_changesets | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
release: | |
- release-all-in-one | |
- release-app | |
- release-local | |
- release-otel-collector | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
docker-images: false | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
swap-storage: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Load Environment Variables from .env | |
uses: xom9ikk/dotenv@v2 | |
- name: Publish Images | |
id: publish | |
if: | |
needs.check_changesets.outputs.changeset_outputs_hasChangesets == | |
'false' | |
run: | | |
OUTPUT=$(make ${{ matrix.release }} 2>&1) | |
echo "$OUTPUT" | |
# Store the output in a file for the specific release target | |
echo "$OUTPUT" > /tmp/${{ matrix.release }}-output.txt | |
# Upload the output as an artifact if this is release-app | |
if [ "${{ matrix.release }}" = "release-app" ]; then | |
if echo "$OUTPUT" | grep -q "already exists. Skipping push."; then | |
echo "RELEASE_APP_PUSHED=false" > /tmp/release-app-status.txt | |
else | |
echo "RELEASE_APP_PUSHED=true" > /tmp/release-app-status.txt | |
fi | |
fi | |
- name: Upload release-app status | |
if: matrix.release == 'release-app' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-app-status | |
path: /tmp/release-app-status.txt | |
check_release_app_pushed: | |
name: Check if release-app pushed | |
needs: [check_changesets, release] | |
runs-on: ubuntu-24.04 | |
outputs: | |
app_was_pushed: ${{ steps.check.outputs.pushed }} | |
if: | |
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false' | |
steps: | |
- name: Download release-app status | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-app-status | |
path: /tmp | |
- name: Check if release-app was pushed | |
id: check | |
run: | | |
if [ -f /tmp/release-app-status.txt ]; then | |
STATUS=$(cat /tmp/release-app-status.txt) | |
echo "Release app status: $STATUS" | |
if [ "$STATUS" = "RELEASE_APP_PUSHED=true" ]; then | |
echo "pushed=true" >> $GITHUB_OUTPUT | |
else | |
echo "pushed=false" >> $GITHUB_OUTPUT | |
fi | |
else | |
echo "No release-app status file found, assuming not pushed" | |
echo "pushed=false" >> $GITHUB_OUTPUT | |
fi | |
notify_helm_charts: | |
name: Notify Helm-Charts Downstream | |
needs: [check_changesets, release, check_release_app_pushed] | |
runs-on: ubuntu-24.04 | |
if: | | |
needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false' && | |
needs.check_release_app_pushed.outputs.app_was_pushed == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Environment Variables from .env | |
uses: xom9ikk/dotenv@v2 | |
- name: Notify Helm-Charts Downstream | |
uses: actions/github-script@v7 | |
continue-on-error: true | |
env: | |
TAG: ${{ env.IMAGE_VERSION }}${{ env.IMAGE_VERSION_SUB_TAG }} | |
with: | |
github-token: ${{ secrets.HYPERDX_INTERNAL_TOKEN }} | |
script: | | |
const { TAG } = process.env; | |
const result = await github.rest.actions.createWorkflowDispatch({ | |
owner: 'hyperdxio', | |
repo: 'helm-charts', | |
workflow_id: '${{ secrets.DOWNSTREAM_HC_WORKFLOW_ID }}', | |
ref: 'main', | |
inputs: { | |
tag: TAG | |
} | |
}); | |
notify_ch: | |
name: Notify CH Downstream | |
needs: [check_changesets, release, check_release_app_pushed] | |
runs-on: ubuntu-24.04 | |
# Temporarily disabled: | |
if: false | |
# if: | | |
# needs.check_changesets.outputs.changeset_outputs_hasChangesets == 'false' && | |
# needs.check_release_app_pushed.outputs.app_was_pushed == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Load Environment Variables from .env | |
uses: xom9ikk/dotenv@v2 | |
- name: Get Downstream App Installation Token | |
id: auth | |
uses: actions/create-github-app-token@v2 | |
with: | |
app-id: ${{ secrets.DOWNSTREAM_CH_APP_ID }} | |
private-key: ${{ secrets.DOWNSTREAM_CH_APP_PRIVATE_KEY }} | |
owner: ${{ secrets.DOWNSTREAM_CH_OWNER }} | |
- name: Notify CH Downstream | |
uses: actions/github-script@v7 | |
continue-on-error: true | |
env: | |
TAG: ${{ env.IMAGE_VERSION }}${{ env.IMAGE_VERSION_SUB_TAG }} | |
with: | |
github-token: ${{ steps.auth.outputs.token }} | |
script: | | |
const { TAG } = process.env; | |
const result = await github.rest.actions.createWorkflowDispatch({ | |
owner: '${{ secrets.DOWNSTREAM_CH_OWNER }}', | |
repo: '${{ secrets.DOWNSTREAM_DP_REPO }}', | |
workflow_id: '${{ secrets.DOWNSTREAM_DP_WORKFLOW_ID }}', | |
ref: 'main', | |
inputs: { | |
tag: TAG | |
} | |
}); |