-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
16 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,18 @@ | ||
name: Publish a pre-release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branch: develop | ||
|
||
jobs: | ||
publish_prerelease: | ||
name: 'Create a prerelease' | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
release_name: 'Development snapshot' | ||
draft: false | ||
prerelease: true | ||
tag_name: latest |
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 |
---|---|---|
|
@@ -7,35 +7,55 @@ on: | |
push: | ||
branch: stable | ||
tags: | ||
- 'v?[0-9]*' | ||
- "v?[0-9]*" | ||
|
||
workflow_call: | ||
inputs: | ||
draft: | ||
description: 'Draft' | ||
description: "Draft" | ||
required: true | ||
default: false | ||
type: boolean | ||
prerelease: | ||
description: 'Prerelease' | ||
description: "Prerelease" | ||
required: true | ||
type: boolean | ||
release_name: | ||
description: "Release name" | ||
required: true | ||
default: "Release ${{ github.ref_name }}" | ||
type: string | ||
tag_name: | ||
description: "Tag name" | ||
required: false | ||
default: "${{ github.ref }}" | ||
type: string | ||
|
||
workflow_dispatch: | ||
inputs: | ||
draft: | ||
description: 'Draft' | ||
description: "Draft" | ||
required: true | ||
default: true | ||
type: boolean | ||
prerelease: | ||
description: 'Prerelease' | ||
description: "Prerelease" | ||
required: true | ||
default: false | ||
type: boolean | ||
release_name: | ||
description: "Release name" | ||
required: true | ||
default: "Draft release" | ||
type: string | ||
tag_name: | ||
description: "Tag name" | ||
required: false | ||
default: null | ||
type: string | ||
|
||
jobs: | ||
package_asset: | ||
package_multiplatform: | ||
name: Build release assets | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -67,40 +87,62 @@ jobs: | |
*.zip | ||
*.exe | ||
public_mac: | ||
name: 'Build release assets (mac)' | ||
package_mac: | ||
name: "Build release assets (mac)" | ||
uses: ./.github/workflows/build_macos.yml | ||
secrets: inherit | ||
|
||
publish_release: | ||
name: Create a GitHub release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- package_asset | ||
- public_mac | ||
- package_multiplatform | ||
- package_mac | ||
|
||
steps: | ||
- name: Install dependencies | ||
- name: "Install dependencies" | ||
uses: taiki-e/install-action@just | ||
|
||
- name: Checkout code | ||
- name: "Checkout code" | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download built game assets | ||
- name: "Download built game assets" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts/ | ||
merge-multiple: true | ||
|
||
- name: Generate Changelog | ||
- name: "Generate changelog" | ||
run: | | ||
just output-current-changelog > _changes.txt | ||
- name: Release | ||
- name: "Get information on the latest pre-release" | ||
if: ${{ inputs.prerelease }} | ||
id: last_release | ||
uses: InsonusK/[email protected] | ||
with: | ||
myToken: ${{ github.token }} | ||
exclude_types: "draft|release" | ||
|
||
- name: 'Mark the pre-release as latest' | ||
if: ${{ inputs.prerelease }} | ||
uses: EndBug/latest-tag@latest | ||
|
||
- name: "Delete old pre-release assets" | ||
if: ${{ inputs.prerelease }} | ||
uses: mknejp/delete-release-assets@v1 | ||
continue-on-error: true | ||
with: | ||
token: ${{ github.token }} | ||
tag: ${{ steps.last_release.outputs.tag_name }} | ||
assets: "*.*" | ||
|
||
- name: "Publish a release" | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
name: Release ${{ github.ref_name }} | ||
name: ${{ inputs.release_name }} | ||
tag_name: ${{ inputs.tag_name }} | ||
body_path: _changes.txt | ||
draft: ${{ inputs.draft }} | ||
prerelease: ${{ inputs.prerelease }} | ||
|
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