changelog #214
Workflow file for this run
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
name: Create Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
jobs: | |
build-linux: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
config: [debug, release] | |
target: [static_lib, shared_lib, cmd] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build ${{matrix.target}} | |
run: | | |
${{matrix.target}}/build.sh ${{matrix.config}} | |
- uses: actions/upload-artifact@v4 | |
name: upload ${{matrix.target}} | |
with: | |
name: linux_x64-${{matrix.target}}-${{matrix.config}} | |
path: | | |
build/** | |
!build/**/*.o | |
!build/**/third-party/** | |
dist-linux: | |
needs: build-linux | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: build/artifacts | |
- name: build dist | |
run: | | |
./dist.sh | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-linux-x64 | |
path: dist | |
build-darwin: | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
config: [debug, release] | |
target: [static_lib, shared_lib, cmd] | |
arch: [arm64, x64] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build ${{matrix.target}} | |
run: | | |
${{matrix.target}}/build.sh ${{matrix.config}} ${{matrix.arch}} | |
- uses: actions/upload-artifact@v4 | |
name: upload ${{matrix.target}} | |
with: | |
name: darwin_${{matrix.arch}}-${{matrix.target}}-${{matrix.config}} | |
path: | | |
build/** | |
!build/**/*.o | |
!build/**/third-party/** | |
dist-darwin: | |
needs: build-darwin | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
arch: [arm64, x64] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: build/artifacts | |
- name: build dist | |
run: | | |
./dist.sh ${{matrix.arch}} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-darwin-${{matrix.arch}} | |
path: dist | |
build-win32: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
config: [debug, release] | |
target: [static_lib, shared_lib, cmd] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build ${{matrix.target}} | |
run: | | |
${{matrix.target}}/build.bat ${{matrix.config}} | |
- uses: actions/upload-artifact@v4 | |
name: upload ${{matrix.target}} | |
with: | |
name: win32_x64-${{matrix.target}}-${{matrix.config}} | |
path: | | |
build/** | |
!build/**/*.obj | |
!build/**/*.o | |
!build/**/third-party/** | |
dist-win32: | |
needs: build-win32 | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: build/artifacts | |
- name: build dist | |
run: | | |
./dist.bat | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-win32-x64 | |
path: dist | |
create-release: | |
runs-on: ubuntu-24.04 | |
needs: [dist-linux, dist-darwin, dist-win32] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download Linux artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-linux-x64 | |
path: dist-linux-x64 | |
- name: Download Win32 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-win32-x64 | |
path: dist-win32-x64 | |
- name: Download darwin x64 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-darwin-x64 | |
path: dist-darwin-x64 | |
- name: Download darwin arm64 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-darwin-arm64 | |
path: dist-darwin-arm64 | |
- name: Zip Linux artifacts | |
uses: montudor/[email protected] | |
with: | |
args: zip -qq -r ./linux-x64.zip ./dist-linux-x64 | |
- name: Zip Win32 artifacts | |
uses: montudor/[email protected] | |
with: | |
args: zip -qq -r ./win32-x64.zip ./dist-win32-x64 | |
- name: Zip darwin x64 artifacts | |
uses: montudor/[email protected] | |
with: | |
args: zip -qq -r ./darwin-x64.zip ./dist-darwin-x64 | |
- name: Zip darwin arm64 artifacts | |
uses: montudor/[email protected] | |
with: | |
args: zip -qq -r ./darwin-arm64.zip ./dist-darwin-arm64 | |
- name: Check prerelease | |
id: get-prerelease | |
uses: haya14busa/action-cond@v1 | |
with: | |
cond: ${{contains(github.ref, '-pre')}} | |
if_true: "true" | |
if_false: "false" | |
- name: Extract Version Changes | |
run: | | |
sed '1,/^##/!d;/##/d' CHANGELOG.md > CHANGELOG.tmp | |
- name: Read CHANGELOG.tmp | |
id: read_changelog | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: "./CHANGELOG.tmp" | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{github.ref.name}} | |
body: | | |
${{steps.read_changelog.outputs.content}} | |
draft: false | |
prerelease: ${{steps.get-prerelease.outputs.value}} | |
files: "*.zip" |