Skip to content

docs: release 4.0

docs: release 4.0 #168

Workflow file for this run

name: Publish a new release
permissions:
contents: write
on:
push:
branch: stable
tags:
- "v?[0-9]*"
workflow_call:
inputs:
draft:
description: "Draft"
required: true
default: false
type: boolean
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
let_mac_fail:
description: "Do not require Mac builds to pass"
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
draft:
description: "Draft"
required: true
default: true
type: boolean
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: github.ref_name
type: string
jobs:
package_multiplatform:
name: Build release assets
runs-on: ubuntu-latest
if: vars.RELEASE_ENABLE == 'true'
strategy:
matrix:
include:
- platform: linux
just_target: package-linux
- platform: win
just_target: package-win-all
- platform: win installer
just_target: package-win-installer
steps:
- name: Install dependencies
uses: taiki-e/install-action@just
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Package asset (${{ matrix.platform }})
run: just ${{ matrix.just_target }}
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: packaged_asset-${{ matrix.platform }}
path: |
*.zip
*.exe
package_mac:
name: "Build release assets (mac)"
if: |
vars.RELEASE_ENABLE == 'true' &&
vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/build_macos.yml
with:
let_mac_fail: ${{ inputs.let_mac_fail }}
secrets: inherit
publish_release:
if: vars.RELEASE_ENABLE == 'true'
name: Create a GitHub release
runs-on: ubuntu-latest
needs:
- package_multiplatform
- package_mac
steps:
- name: "Install dependencies"
uses: taiki-e/install-action@just
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Download built game assets"
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: "Generate changelog"
run: |
just output-current-changelog > _changes.txt
- 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: ${{ inputs.release_name }}
tag_name: ${{ inputs.tag_name }}
body_path: _changes.txt
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
fail_on_unmatched_files: true
files: |
artifacts/*