Skip to content

Commit

Permalink
release: mesonization #1
Browse files Browse the repository at this point in the history
  • Loading branch information
rindeal authored Aug 8, 2024
1 parent bab745c commit aeb0f15
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# trunk-ignore-all(yamllint/quoted-strings)
# trunk-ignore-all(checkov/CKV_GHA_7)

name: Release

Expand All @@ -9,10 +10,16 @@ on:
push:
tags:
- v*.*.*
workflow_dispatch:
inputs:
ref_name:
description: ref_name
required: true
type: string

env:
GH_TAG: ${{ github.ref_name }}
ASSET_BASENAME: "amalgamate-${{ github.ref_name }}"
GH_TAG: ${{ github.ref_name || inputs.ref_name }}
ASSET_BASENAME: "amalgamate-${{ github.ref_name || inputs.ref_name }}"

jobs:
draft:
Expand Down Expand Up @@ -45,23 +52,39 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

linux_n_macos:
binaries:
needs: [ draft ]
strategy: { matrix: { os: [ ubuntu-latest, macos-13, macos-latest ] } }
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with: { submodules: true }

- name: Build
run: make
- uses: actions/checkout@main
with:
submodules: true

- id: setup
run: |
platform="$(uname -s)"
arch="$(uname -m)"
echo "basename=${ASSET_BASENAME}-${platform,,}-${arch,,}" >> $GITHUB_OUTPUT
- run: pipx install -- meson ninja
- run: meson setup --reconfigure --buildtype=release -- build
- run: meson compile --jobs 4 --verbose -C build
- run: meson install --destdir "${BASENAME}" -C build
env: { BASENAME: "${{ steps.setup.outputs.basename }}", }
- run: zip -r "${BASENAME}.zip" "build/${BASENAME}"
env: { BASENAME: "${{ steps.setup.outputs.basename }}", }
- run: release upload --clobber "${GH_TAG}" "${BASENAME}.zip"
env:
BASENAME: "${{ steps.setup.outputs.basename }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Create and upload assets
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
run: make gh-upload

windows:
needs: [ draft ]
if: false
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -82,7 +105,8 @@ jobs:
run: gh release upload --clobber "${GH_TAG}" "${ARCHIVE_PATH}"

finish:
needs: [ source_code, linux_n_macos, windows ]
needs: [ source_code, binaries ]
if: false
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit aeb0f15

Please sign in to comment.