mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
ci: publish images in release workflow (#604)
This commit is contained in:
parent
a111b064af
commit
3fb3169f43
12 changed files with 122 additions and 31 deletions
|
|
@ -6,6 +6,5 @@
|
|||
"linked": [],
|
||||
"access": "restricted",
|
||||
"baseBranch": "v2",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": ["@hyperdx/api", "@hyperdx/app"]
|
||||
"updateInternalDependencies": "patch"
|
||||
}
|
||||
|
|
|
|||
10
.changeset/pre.json
Normal file
10
.changeset/pre.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"mode": "pre",
|
||||
"tag": "beta",
|
||||
"initialVersions": {
|
||||
"@hyperdx/api": "1.9.0",
|
||||
"@hyperdx/app": "1.9.0",
|
||||
"@hyperdx/common-utils": "0.1.0"
|
||||
},
|
||||
"changesets": ["famous-poets-rush", "perfect-nails-doubt", "taco-cat-v2"]
|
||||
}
|
||||
5
.changeset/taco-cat-v2.md
Normal file
5
.changeset/taco-cat-v2.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": major
|
||||
---
|
||||
|
||||
bumps to v2 beta
|
||||
3
.env
3
.env
|
|
@ -6,7 +6,8 @@ LOCAL_IMAGE_NAME=ghcr.io/hyperdxio/hyperdx-local
|
|||
LOCAL_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-local
|
||||
OTEL_COLLECTOR_IMAGE_NAME=ghcr.io/hyperdxio/hyperdx-otel-collector
|
||||
OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-otel-collector
|
||||
IMAGE_VERSION_SUB_TAG=.8
|
||||
CHANGESET_TAG=2.0.0-beta.9
|
||||
IMAGE_VERSION_SUB_TAG=.9
|
||||
IMAGE_VERSION=2-beta
|
||||
|
||||
# Set up domain URLs
|
||||
|
|
|
|||
66
.github/workflows/release.yml
vendored
66
.github/workflows/release.yml
vendored
|
|
@ -3,13 +3,23 @@ on:
|
|||
push:
|
||||
branches: [v2]
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
publish_common_utils:
|
||||
name: Publish @hyperdx/common-utils
|
||||
runs-on: ubuntu-latest
|
||||
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:
|
||||
|
|
@ -22,19 +32,49 @@ jobs:
|
|||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
commit: 'chore(release): bump HyperDX app/package versions'
|
||||
title: 'chore(release): bump HyperDX app/package versions'
|
||||
version: yarn run version
|
||||
publish: yarn release
|
||||
env:
|
||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
continue-on-error: true
|
||||
- name: Creating .npmrc
|
||||
run: |
|
||||
cat << EOF > "$HOME/.npmrc"
|
||||
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
||||
EOF
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- name: Publish
|
||||
if: steps.changesets.outputs.hasChangesets == 'false'
|
||||
# You can do something when a publish should happen.
|
||||
run: yarn release
|
||||
release:
|
||||
name: Release
|
||||
needs: publish_common_utils
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
release:
|
||||
[
|
||||
'release-app',
|
||||
'release-otel-collector',
|
||||
'release-local',
|
||||
'release-local-ui',
|
||||
]
|
||||
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: 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
|
||||
if:
|
||||
needs.publish_common_utils.outputs.changeset_outputs_hasChangesets ==
|
||||
'false'
|
||||
run: make ${{ matrix.release }}
|
||||
|
|
|
|||
28
Makefile
28
Makefile
|
|
@ -84,7 +84,12 @@ release-local:
|
|||
-t ${LOCAL_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \
|
||||
-t ${LOCAL_IMAGE_NAME}:${IMAGE_VERSION} \
|
||||
-t ${LOCAL_IMAGE_NAME}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \
|
||||
--push &
|
||||
--push \
|
||||
--cache-from=type=gha \
|
||||
--cache-to=type=gha,mode=max
|
||||
|
||||
.PHONY: release-local-ui
|
||||
release-local-ui:
|
||||
docker buildx build . -f ./packages/app/Dockerfile \
|
||||
--build-arg IS_LOCAL_MODE=true \
|
||||
--build-arg PORT=${HYPERDX_APP_PORT} \
|
||||
|
|
@ -94,16 +99,24 @@ release-local:
|
|||
-t ${LOCAL_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION}-ui \
|
||||
-t ${LOCAL_IMAGE_NAME}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG}-ui \
|
||||
-t ${LOCAL_IMAGE_NAME}:${IMAGE_VERSION}-ui \
|
||||
--push
|
||||
--push \
|
||||
--cache-from=type=gha \
|
||||
--cache-to=type=gha,mode=max
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
.PHONY: release-otel-collector
|
||||
release-otel-collector:
|
||||
docker buildx build --platform ${BUILD_PLATFORMS} ./docker/otel-collector \
|
||||
-t ${OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \
|
||||
-t ${OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION} \
|
||||
-t ${OTEL_COLLECTOR_IMAGE_NAME}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \
|
||||
-t ${OTEL_COLLECTOR_IMAGE_NAME}:${IMAGE_VERSION} \
|
||||
--target prod --push & \
|
||||
--target prod \
|
||||
--push \
|
||||
--cache-from=type=gha \
|
||||
--cache-to=type=gha,mode=max
|
||||
|
||||
.PHONY: release-app
|
||||
release-app:
|
||||
docker buildx build --squash . -f ./docker/fullstack/Dockerfile \
|
||||
--build-context fullstack=./docker/fullstack \
|
||||
--build-context api=./packages/api \
|
||||
|
|
@ -113,4 +126,7 @@ release:
|
|||
-t ${IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION} \
|
||||
-t ${IMAGE_NAME}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \
|
||||
-t ${IMAGE_NAME}:${IMAGE_VERSION} \
|
||||
--target prod --push
|
||||
--target prod \
|
||||
--push \
|
||||
--cache-from=type=gha \
|
||||
--cache-to=type=gha,mode=max
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
"dev": "yarn app:dev",
|
||||
"postdev": "docker compose -f docker-compose.dev.yml down",
|
||||
"lint": "npx nx run-many -t ci:lint",
|
||||
"version": "npx changeset version && yarn",
|
||||
"version": "make version",
|
||||
"release": "npx nx run-many --target=build --projects=@hyperdx/common-utils && npx changeset publish"
|
||||
},
|
||||
"lint-staged": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# @hyperdx/api
|
||||
|
||||
## 2.0.0-beta.0
|
||||
|
||||
## 1.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@hyperdx/api",
|
||||
"version": "1.9.0",
|
||||
"version": "2.0.0-beta.9",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"engines": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,16 @@
|
|||
# @hyperdx/app
|
||||
|
||||
## 2.0.0-beta.0
|
||||
|
||||
### Major Changes
|
||||
|
||||
- bumps to v2 beta
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- b3f3151: Allow to create Slack Webhooks from Team Settings page
|
||||
- b690db8: Introduce event panel overview tab
|
||||
|
||||
## 1.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@hyperdx/app",
|
||||
"version": "2-beta",
|
||||
"version": "2.0.0-beta.9",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
|
|
|
|||
19
version.sh
19
version.sh
|
|
@ -1,6 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
yarn changeset version
|
||||
# update packages versions
|
||||
npx changeset version
|
||||
|
||||
# upload yarn.lock
|
||||
yarn
|
||||
|
||||
# update root package.json version
|
||||
API_LATEST_VERSION=$(sed -n 's/.*"version": "\([^"]*\)".*/\1/p' ./packages/api/package.json)
|
||||
|
|
@ -13,11 +17,14 @@ if [ "$API_LATEST_VERSION" != "$APP_LATEST_VERSION" ]; then
|
|||
fi
|
||||
|
||||
# update root package.json version
|
||||
sed -i '' -e "s/\"version\": \".*\"/\"version\": \"$API_LATEST_VERSION\"/g" ./package.json
|
||||
sed -i '' 's/\("version":\s*"\)[^"]*/\"$API_LATEST_VERSION\"/' package.json
|
||||
echo "Updated root package.json version to $API_LATEST_VERSION"
|
||||
|
||||
# update .env IMAGE_VERSION
|
||||
sed -i '' -e "s/IMAGE_VERSION=.*/IMAGE_VERSION=$API_LATEST_VERSION/g" ./.env
|
||||
echo "Updated .env IMAGE_VERSION to $API_LATEST_VERSION"
|
||||
# update tags in .env
|
||||
sed -i '' -e "s/CHANGESET_TAG=.*/CHANGESET_TAG=$API_LATEST_VERSION/g" ./.env
|
||||
echo "Updated .env CHANGESET_TAG to $API_LATEST_VERSION"
|
||||
|
||||
echo "Run 'make release' to publish new version to GHCR"
|
||||
sed -i '' -e "s/IMAGE_VERSION_SUB_TAG=.*/IMAGE_VERSION_SUB_TAG=${API_LATEST_VERSION##*-beta}/g" ./.env
|
||||
echo "Updated .env IMAGE_VERSION_SUB_TAG to ${API_LATEST_VERSION##*-beta}"
|
||||
|
||||
echo "Run 'make release' to publish images"
|
||||
|
|
|
|||
Loading…
Reference in a new issue