Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/prerelease-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"always-update": true,
"changelog-type": "default",
"commit-search-depth": 50,
"draft": true,
"force-tag-creation": true,
"include-commit-authors": true,
"include-component-in-tag": false,
"include-v-in-release-name": true,
"include-v-in-tag": true,
"initial-version": "2.9.0",
"prerelease": true,
"prerelease-type": "rc.1",
"release-type": "node",
"versioning": "prerelease",
"packages": {
".": {
"changelog-sections": [
{ "type": "feat", "section": ":sparkles: Features" },
{ "type": "feature", "section": ":sparkles: Features" },
{ "type": "fix", "section": ":bug: Bug Fixes" },
{ "type": "patch", "section": ":bug: Bug Fixes" },
{ "type": "perf", "section": ":zap: Performance Improvements" },
{ "type": "refactor", "section": ":wrench: Code Refactoring" },
{ "type": "docs", "section": ":books: Documentation" },
{ "type": "style", "section": ":art: Styles" },
{ "type": "test", "section": ":test_tube: Tests" },
{ "type": "build", "section": ":building_construction: Build System and dependencies" },
{ "type": "ci", "section": ":building_construction: Build System and dependencies" },
{ "type": "chore", "section": ":broom: Chores", "hidden": false },
{ "type": "revert", "section": ":rewind: Reverts" }
]
}
}
}
1 change: 1 addition & 0 deletions .github/prerelease-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ }
43 changes: 43 additions & 0 deletions .github/release-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"always-update": true,
"changelog-type": "default",
"commit-search-depth": 50,
"draft": true,
"force-tag-creation": true,
"include-commit-authors": true,
"include-component-in-tag": false,
"include-v-in-release-name": true,
"include-v-in-tag": true,
"initial-version": "2.9.0",
"prerelease": false,
"prerelease-type": "rc.1",
"release-type": "node",
"versioning": "default",
"packages": {
".": {
"changelog-sections": [
{ "type": "feat", "section": ":sparkles: Features" },
{ "type": "feature", "section": ":sparkles: Features" },
{ "type": "fix", "section": ":bug: Bug Fixes" },
{ "type": "patch", "section": ":bug: Bug Fixes" },
{ "type": "perf", "section": ":zap: Performance Improvements" },
{ "type": "refactor", "section": ":wrench: Code Refactoring" },
{ "type": "docs", "section": ":books: Documentation" },
{ "type": "style", "section": ":art: Styles" },
{ "type": "test", "section": ":test_tube: Tests" },
{ "type": "build", "section": ":building_construction: Build System and dependencies" },
{ "type": "ci", "section": ":building_construction: Build System and dependencies" },
{ "type": "chore", "section": ":broom: Chores", "hidden": false },
{ "type": "revert", "section": ":rewind: Reverts" }
],
"extra-files": [
{
"type": "json",
"path": ".github/prerelease-manifest.json",
"jsonpath": "$[\".\"]"
}
]
}
}
}
1 change: 1 addition & 0 deletions .github/release-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ }
11 changes: 0 additions & 11 deletions .github/release.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/create-release.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/docker-publish.yml

This file was deleted.

160 changes: 160 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Create release

on:
push:
branches:
- main
workflow_dispatch:
inputs:
prerelease:
description: Create a prerelease instead of a release
type: boolean
required: false
default: false

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created || steps.prerelease.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name || steps.prerelease.outputs.tag_name }}
is_prerelease: ${{ steps.detect-prerelease.outputs.is_prerelease }}

steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Detect prerelease from version in package.json
id: detect-prerelease
run: |
VERSION=$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' package.json | head -n 1)
IS_PRERELEASE=false
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then
IS_PRERELEASE=true
fi
echo "is_prerelease=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"

- name: Create prerelease
if: (github.event_name == 'workflow_dispatch' && inputs.prerelease == true) || steps.detect-prerelease.outputs.is_prerelease == 'true'
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: prerelease
with:
config-file: .github/prerelease-config.json
manifest-file: .github/prerelease-manifest.json

- name: Create release
if: (github.event_name == 'workflow_dispatch' && inputs.prerelease == false) || steps.detect-prerelease.outputs.is_prerelease == 'false'
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
id: release
with:
config-file: .github/release-config.json
manifest-file: .github/release-manifest.json

upload-asset:
needs: release
if: ${{ needs.release.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write

env:
TAG_NAME: ${{ needs.release.outputs.tag_name }}

steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.x
cache: 'npm'

- run: npm ci

- run: npm run build-artifact

- name: Create zip file
run: pushd packages/pxweb2/dist && zip -r $OLDPWD/pxweb-${{ env.TAG_NAME }}.zip ./

- name: Upload release asset
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ env.TAG_NAME }} pxweb-${{ env.TAG_NAME }}.zip

docker-publish:
needs: release
if: ${{ needs.release.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TAG_NAME: ${{ needs.release.outputs.tag_name }}

steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=${{ env.TAG_NAME }}
type=semver,pattern={{major}}.{{minor}},value=${{ env.TAG_NAME }}
type=semver,pattern={{major}},value=${{ env.TAG_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

publish-release:
needs: [release, upload-asset, docker-publish]
if: ${{ needs.release.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: write

env:
TAG_NAME: ${{ needs.release.outputs.tag_name }}

steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release edit ${{ env.TAG_NAME }} --draft=false
Loading
Loading