Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Added Changelog to release body #10

Added Changelog to release body

Added Changelog to release body #10

Workflow file for this run

name: Release
on:
push:
tags:
- 'aether-core@v*'
env:
# name of the main binary
binary: aether-core
permissions:
contents: write
jobs:
# Build for Linux
build-linux:
runs-on: ubuntu-latest
outputs:
pre_release: ${{ steps.pre_release_check.outputs.PRERELEASE }}
release_name: ${{ steps.release_name.outputs.RELEASENAME }}
release_body: ${{ steps.parse_changelog.outputs.latestBody }}
steps:
- uses: olegtarasov/get-tag@v2.1.3
id: get_version
with:
tagRegex: "aether-core@(?<version>v\\d+\\.\\d+\\.\\d+)-(?<prerelease>(alpha|beta|rc)\\.\\d+)"
- name: pre-release check
id: pre_release_check
run: |
echo "PRERELEASE=${{ steps.get_version.outputs.prerelease == '' }}" >> "GITHUB_OUTPUT"
- name: release name generation
id: release_name
run: |
echo "RELEASENAME=Aether Core ${{ steps.get_version.outputs.version }} ${{ steps.get_version.outputs.prerelease }}" >> "GITHUB_OUTPUT"
- name: Parse Changelog
id: parse_changelog
uses: ocavue/changelog-parser-action@v1
with:
filepath: "./aether-core/CHANGELOG.md"
- uses: actions/checkout@v4
- name: Identify rust toolchain
id: toolchain
uses: jaywcjlove/github-action-read-file@main
with:
localfile: rust-toolchain
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.content }}
targets: x86_64-unknown-linux-gnu
- name: install dependencies
run: |
sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-gnu -p aether-core
- name: Prepare package
run: |
mkdir linux
cp target/x86_64-unknown-linux-gnu/release/${{ env.binary }} linux/
- name: Package as a zip
working-directory: ./linux
run: |
zip --recurse-paths ../${{ env.binary }}.zip .
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}.zip
name: linux
retention-days: 1
- name: Upload linux binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.zip
asset_name: ${{ env.binary }}-linux-${{ steps.release_name.outputs.RELEASENAME }}.zip
tag: ${{ github.ref }}
overwrite: true
body: ${{ steps.parse_changelog.outputs.latestBody }}
prerelease: ${{ steps.pre_release_check.outputs.PRERELEASE }}
release_name: ${{ steps.release_name.outputs.RELEASENAME }}
# Build for Windows
build-windows:
runs-on: windows-latest
needs: build-linux
steps:
- uses: actions/checkout@v4
- name: Identify rust toolchain
id: toolchain
uses: jaywcjlove/github-action-read-file@main
with:
localfile: rust-toolchain
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.content }}
targets: x86_64-pc-windows-msvc
- name: Build
run: |
cargo build --release --target x86_64-pc-windows-msvc -p aether-core
- name: Prepare package
run: |
mkdir windows
cp target/x86_64-pc-windows-msvc/release/${{ env.binary }}.exe windows/
- name: Package as a zip
run: |
Compress-Archive -Path windows/* -DestinationPath ${{ env.binary }}.zip
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}.zip
name: windows
retention-days: 1
- name: Upload windows binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.zip
asset_name: ${{ env.binary }}-windows-${{ needs.build-linux.outputs.release_name }}.zip
tag: ${{ github.ref }}
overwrite: true
body: ${{ needs.build-linux.outputs.release_body }}
prerelease: ${{ needs.build-linux.outputs.pre_release }}
release_name: ${{ needs.build-linux.outputs.release_name }}
# Build for MacOS Apple Silicon
build-macOS-apple-silicon:
runs-on: macOS-latest
needs: build-linux
steps:
- uses: actions/checkout@v4
- name: Identify rust toolchain
id: toolchain
uses: jaywcjlove/github-action-read-file@main
with:
localfile: rust-toolchain
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.content }}
targets: aarch64-apple-darwin
- name: Environment
# macOS 11 was the first version to support ARM
run: |
export MACOSX_DEPLOYMENT_TARGET="11"
- name: Install llvm
run: |
brew install llvm
- name: Build
run: |
cargo build --release --target aarch64-apple-darwin -p aether-core
- name: Prepare Package
run: |
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
hdiutil create -fs HFS+ -volname "${{ env.binary }}-macOS-apple-silicon" -srcfolder ${{ env.binary }}.app ${{ env.binary }}-macOS-apple-silicon.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.binary }}-macOS-apple-silicon.dmg
name: macOS-apple-silicon
retention-days: 1
- name: Upload macOS-apple-silicon binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}-macOS-apple-silicon.dmg
asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ needs.build-linux.outputs.release_name }}.dmg
tag: ${{ github.ref }}
overwrite: true
body: ${{ needs.build-linux.outputs.release_body }}
prerelease: ${{ needs.build-linux.outputs.pre_release }}
release_name: ${{ needs.build-linux.outputs.release_name }}