ci: Update release

This commit is contained in:
2025-10-29 19:36:49 +03:00
parent 9607f99932
commit 0a8f82f0d6
2 changed files with 42 additions and 11 deletions

View File

@@ -10,7 +10,33 @@ permissions:
contents: write contents: write
jobs: jobs:
release: semantic-release:
name: Sematic Release
runs-on: self-hosted
outputs:
tmpFileName: ${{ steps.tempFileName.outputs.name }}
steps:
- name: Generate tempFile Name
id: tempFileName
run: |
echo "name=$(openssl rand -hex 36)" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release
run: |
yarn install
yarn semantic-release
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: 'ReleaseArtifact'
path: /tmp/${{ steps.tempFileName.outputs.name }}
retention-days: 2
goreleaser:
needs: semantic-release
name: Goreleaser
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- name: Checkout - name: Checkout
@@ -23,9 +49,13 @@ jobs:
go-version: '^1.25' go-version: '^1.25'
- name: Install go release - name: Install go release
run: go install github.com/goreleaser/goreleaser/v2@latest run: go install github.com/goreleaser/goreleaser/v2@latest
- name: Release - name: Download release artifact
run: | uses: actions/download-artifact@v5
yarn install with:
yarn semantic-release name: 'ReleaseArtifact'
path: /tmp/${{ needs.semantic-release.outputs.tmpFileName }}
- name: Run Goreleaser
env: env:
GITEA_TOKEN: ${{ secrets.GORELEASER_TOKEN }} GITEA_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
run: |
goreleaser release --release-notes /tmp/${{ needs.semantic-release.outputs.tmpFileName }} --clean

View File

@@ -44,15 +44,16 @@ module.exports = {
[ [
"@semantic-release/exec", "@semantic-release/exec",
{ {
publishCmd: 'echo -e "${nextRelease.notes}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md' publishCmd: 'echo "${nextRelease.notes}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md; echo "${nextRelease.notes}" > "/tmp/${process.env.TMP_FILE_NAME}";',
} }
], ],
'@semantic-release/git',
[ [
"@semantic-release/exec", '@semantic-release/git',
{ {
"publishCmd": 'echo "${nextRelease.notes}" > /tmp/release-notes.md; goreleaser release --release-notes /tmp/release-notes.md --clean' assets: [
'CHANGELOG.md'
]
} }
] ],
], ],
}; };