This commit is contained in:
charlesgauthereau
2026-03-06 17:25:33 +01:00
parent c7ca01c0fb
commit 3d51d3548f
2 changed files with 26 additions and 16 deletions
+23 -14
View File
@@ -72,7 +72,7 @@ name: Auto Release & Publish
on: on:
pull_request: pull_request:
types: [closed] types: [ closed ]
branches: branches:
- main - main
@@ -84,6 +84,8 @@ jobs:
release: release:
if: github.event.pull_request.merged == true if: github.event.pull_request.merged == true
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
draft_tag: ${{ steps.release_step.outputs.draft_tag }}
steps: steps:
- uses: actions/create-github-app-token@v1 - uses: actions/create-github-app-token@v1
id: app-token id: app-token
@@ -109,26 +111,33 @@ jobs:
git config --global user.name 'github-actions[bot]' git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com' git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Bump version & push tag - name: Run release-it
id: bump id: release_step
run: | run: |
pnpm exec release-it --ci --no-npm git pull origin main
OUTPUT=$(pnpm exec release-it --ci)
echo "$OUTPUT"
# Extract the untagged draft release name
DRAFT_TAG=$(echo "$OUTPUT" | grep -o 'releases/tag/[^ ]*' | sed 's|releases/tag/||')
echo "draft_tag=$DRAFT_TAG" >> $GITHUB_OUTPUT
env: env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# - name: Build & publish Docker
# uses: ./.github/workflows/docker.yml # - name: Build & publish Docker
# with: # uses: ./.github/workflows/docker.yml
# add_latest: true # with:
# secrets: # add_latest: true
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME_2 }} # secrets:
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD_2 }} # DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME_2 }}
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD_2 }}
- name: Publish GitHub Release - name: Publish GitHub Release
run: |
pnpm exec release-it ${{ steps.bump.outputs.version }} --ci --no-npm --no-git
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release edit ${{ steps.release_step.outputs.draft_tag }} --draft=false
- name: Notify Discord - name: Notify Discord
uses: ./.github/workflows/discord.yml uses: ./.github/workflows/discord.yml
+3 -2
View File
@@ -1,8 +1,9 @@
{ {
"github": { "github": {
"release": true, "release": true,
"draft": false, "draft": true,
"tokenRef": "GITHUB_TOKEN" "tokenRef": "GITHUB_TOKEN",
"update": true
}, },
"git": { "git": {
"commit": true, "commit": true,