-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rework release process (#1367)
For details see the updated contributor documentation.
- Loading branch information
Showing
12 changed files
with
190 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
change-template: '- $TITLE by @$AUTHOR in #$NUMBER' | ||
change-title-escapes: '\<*_&' | ||
sort-direction: ascending | ||
exclude-labels: | ||
- dependency | ||
- no-changelog | ||
- documentation | ||
categories: | ||
- title: '🚨 Breaking Changes' | ||
labels: | ||
- breaking-change | ||
- title: '🚀 Features' | ||
labels: | ||
- enhancement | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- bug | ||
version-resolver: | ||
major: | ||
labels: | ||
- breaking-change | ||
minor: | ||
labels: | ||
- enhancement | ||
patch: | ||
labels: | ||
- bug | ||
template: | | ||
$CHANGES | ||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: pr-label-check | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- labeled | ||
- unlabeled | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-changelog-labels: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: PR has no changelog label | ||
if: | | ||
!contains(github.event.pull_request.labels.*.name, 'bug') && | ||
!contains(github.event.pull_request.labels.*.name, 'enhancement') && | ||
!contains(github.event.pull_request.labels.*.name, 'breaking-change') && | ||
!contains(github.event.pull_request.labels.*.name, 'no-changelog') | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: draft-releases | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
draft-releases: | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
pull-requests: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: draft next | ||
uses: leukeleu/release-drafter@filter-draft-releases | ||
with: | ||
prerelease: true | ||
prerelease-identifier: next | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: draft stable | ||
uses: leukeleu/release-drafter@filter-draft-releases | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,75 @@ | ||
name: release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
nuget_source: | ||
required: false | ||
type: string | ||
default: 'https://api.nuget.org/v3/index.json' | ||
environment: | ||
required: true | ||
type: string | ||
secrets: | ||
NUGET_API_TOKEN: | ||
required: true | ||
outputs: | ||
version: | ||
description: 'The created version' | ||
value: ${{ jobs.release.outputs.version }} | ||
release: | ||
types: | ||
- published | ||
|
||
# required secrets: NUGET_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN | ||
env: | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
DOTNET_NOLOGO: true | ||
NUGET_SOURCE: 'https://nuget.pkg.github.com/latonz/index.json' #'https://api.nuget.org/v3/index.json' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
environment: ${{ github.event.release.prerelease && 'next' || 'stable' }} | ||
permissions: | ||
contents: write | ||
outputs: | ||
version: ${{ steps.release-version.outputs.version }} | ||
version: ${{ steps.extract-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: checkout git | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-dotnet@v4 | ||
- uses: actions/setup-node@v4 | ||
- id: extract-version | ||
name: extract version | ||
run: echo "RELEASE_VERSION=${RELEASE_NAME#v}" >> "$GITHUB_OUTPUT" | ||
env: | ||
RELEASE_NAME: ${{ github.event.release.name }} | ||
- name: extract release notes | ||
id: extract-release-notes | ||
run: | | ||
{ | ||
echo 'RELEASE_NOTES<<EOF'; | ||
gh release view '${{ github.event.release.name }}' --json body --jq .body; | ||
echo 'EOF' | ||
} >> "$GITHUB_OUTPUT" | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: convert release notes markdown to text | ||
id: release-notes-text | ||
uses: koistya/strip-markdown@v1 | ||
with: | ||
node-version: '18' | ||
- run: sudo apt update && sudo apt -y install zipmerge # zipmerge is used to merge the multi target nupkg | ||
- run: | | ||
npm i \ | ||
semantic-release@21.0.2 \ | ||
conventional-changelog-conventionalcommits@5.0.0 \ | ||
@semantic-release/exec@6.0.3 \ | ||
@semantic-release/commit-analyzer@9.0.2 \ | ||
@semantic-release/release-notes-generator@10.0.3 \ | ||
@semantic-release/github@8.0.7 | ||
- run: npx semantic-release | ||
content: ${{ steps.extract-release-notes.outputs.RELEASE_NOTES }} | ||
- name: setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
- name: install dependencies | ||
run: sudo apt update && sudo apt -y install zipmerge # zipmerge is used to merge the multi target nupkg | ||
- name: build release | ||
run: ./build/package.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NUGET_SOURCE: ${{ inputs.nuget_source }} | ||
NUGET_API_TOKEN: ${{ secrets.NUGET_API_TOKEN }} | ||
MAPPERLY_ENVIRONMENT: ${{ inputs.environment }} | ||
- id: release-version | ||
run: echo "version=${{ env.RELEASE_VERSION }}" >> "$GITHUB_OUTPUT" | ||
MAPPERLY_ENVIRONMENT: ${{ github.event.release.prerelease && 'next' || 'stable' }} | ||
RELEASE_NOTES: ${{ steps.release-notes-text.outputs.content }} | ||
RELEASE_VERSION: ${{ steps.extract-version.outputs.RELEASE_VERSION }} | ||
- name: publish nuget | ||
run: dotnet nuget push './artifacts/*.nupkg' --source "$NUGET_SOURCE" --api-key '${{ secrets.NUGET_API_TOKEN }}' | ||
- name: add release assets | ||
run: gh release upload "${{ github.event.release.name }}" artifacts/*.nupkg | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
docs: | ||
uses: ./.github/workflows/docs.yml | ||
needs: release | ||
with: | ||
deploy: true | ||
environment: ${{ github.event.release.prerelease && 'next' || 'stable' }} | ||
version: ${{ needs.release.outputs.version }} | ||
secrets: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.