-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Automate release flow (#45)
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 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,4 @@ | ||
changelogPolicy: auto | ||
preReleaseCommand: pwsh scripts/bump-version.ps1 | ||
targets: | ||
- name: github |
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,36 @@ | ||
name: 📦 Package | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sentry-godot-gdextension | ||
path: artifact/ | ||
|
||
- name: Prepare artifact | ||
shell: bash | ||
run: | | ||
# * Fix crashpad_handler permissions, workaround for https://github.com/actions/upload-artifact/issues/38 | ||
chmod +x artifact/addons/sentrysdk/bin/{linux,macos}/crashpad_handler | ||
# * Create release archive | ||
version=$(grep 'VERSION =' SConstruct | cut -d '"' -f 2) | ||
git_short_sha=$(git rev-parse --short HEAD) | ||
archive_file="sentry-godot-gdextension-${version}+${git_short_sha}.zip" | ||
cd artifact/ | ||
mkdir ${GITHUB_WORKSPACE}/out/ | ||
zip -r ${GITHUB_WORKSPACE}/out/${archive_file} ./* | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{github.sha}} | ||
path: out/* |
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,37 @@ | ||
name: 🎁 Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version to release | ||
required: true | ||
force: | ||
description: Force a release even when there are release-blockers (optional) | ||
required: false | ||
|
||
jobs: | ||
job_release: | ||
runs-on: ubuntu-latest | ||
name: 'Release a new version: ${{ github.event.inputs.version }}' | ||
steps: | ||
- name: Get auth token | ||
id: token | ||
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | ||
with: | ||
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
|
||
- name: Check out current commit (${{ github.sha }}) | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.token.outputs.token }} | ||
fetch-depth: 0 | ||
|
||
- name: Prepare release ${{ github.event.inputs.version }} | ||
uses: getsentry/action-prepare-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
force: ${{ github.event.inputs.force }} |
Empty file.
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,19 @@ | ||
Param( | ||
[Parameter(Mandatory = $true)][String]$prevVersion, | ||
[Parameter(Mandatory = $true)][String]$newVersion | ||
) | ||
Set-StrictMode -Version latest | ||
|
||
$sconsFile = "$PSScriptRoot/../SConstruct" | ||
$content = Get-Content $sconsFile | ||
$content -replace 'VERSION = ".*"', ('VERSION = "' + $newVersion + '"') | Out-File $sconsFile | ||
|
||
# Check that the version was updated. | ||
if ("$content" -eq "$(Get-Content $sconsFile)") | ||
{ | ||
$versionInFile = [regex]::Match("$content", 'VERSION = "([^"]+)"').Groups[1].Value | ||
if ("$versionInFile" -ne "$newVersion") | ||
{ | ||
Throw "Failed to update version in $sconsFile - the content didn't change. The version found in the file is '$versionInFile'." | ||
} | ||
} |