ci: Update release
This commit is contained in:
40
.github/workflows/release.yml
vendored
40
.github/workflows/release.yml
vendored
@@ -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
|
||||||
@@ -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'
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user