Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

ci: build and package with version number

Lars Berger07789411cb7c
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 59792d18..6f4996dc 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -2,6 +2,9 @@ name: Build
on:
workflow_call:
+ inputs:
+ version-number:
+ type: string
pull_request:
types: [opened, synchronize, reopened]
@@ -30,16 +33,21 @@ jobs:
with:
shared-key: ${{ matrix.rust-target }}-${{ hashFiles('Cargo.lock') }}
+ - name: Create output directories
+ run: mkdir tmp/noconsole tmp/console
+
- name: Build (windows subsystem)
+ env:
+ VERSION_NUMBER: ${{ inputs.version-number || '0.0.0' }}
run: |
cargo build --locked --release --target ${{ matrix.rust-target }} --features no_console
- mkdir tmp/noconsole
mv target/${{ matrix.rust-target }}/release/{wm,watcher}.exe tmp/noconsole
- name: Build (console subsystem)
+ env:
+ VERSION_NUMBER: ${{ inputs.version-number || '0.0.0' }}
run: |
cargo build --locked --release --target ${{ matrix.rust-target }}
- mkdir tmp/console
mv target/${{ matrix.rust-target }}/release/{wm,watcher}.exe tmp/console
- uses: actions/upload-artifact@v4
diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml
index d883f1d9..d814c0b0 100644
--- a/.github/workflows/package.yaml
+++ b/.github/workflows/package.yaml
@@ -4,10 +4,17 @@ on:
workflow_call:
jobs:
+ next-version:
+ uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@3c2d88ce0390012bac0b8383059a0b67d2594dc1
+
build:
+ needs: [next-version]
uses: ./.github/workflows/build.yaml
+ with:
+ version-number: ${{ needs.next-version.outputs.new-release-version }}
package:
+ needs: [next-version, build]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
@@ -22,7 +29,7 @@ jobs:
run: |
$latestRelease = 'https://api.github.com/repos/glzr-io/zebar/releases/latest'
$latestInstallers = Invoke-RestMethod $latestRelease | % assets | ? name -like "*.msi"
- $latestInstallers | % { Invoke-WebRequest $_.browser_download_url -OutFile $_.name }
+ $latestInstallers | % { Invoke-WebRequest $_.browser_download_url -OutFile (Join-Path "tmp" $_.name) }
- name: Install WiX and its extensions
run: |
@@ -30,16 +37,22 @@ jobs:
wix extension add WixToolset.UI.wixext/5 WixToolset.Util.wixext/5 WixToolset.BootstrapperApplications.wixext/5
- name: Create MSI installer (x64)
+ env:
+ VERSION_NUMBER: ${{ needs.next-version.outputs.new-release-version }}
run: |
wix build -arch "x64" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext \
-out "./tmp/installer-x64.msi" "./resources/standalone.wxs"
- name: Create MSI installer (arm64)
+ env:
+ VERSION_NUMBER: ${{ needs.next-version.outputs.new-release-version }}
run: |
wix build -arch "arm64" -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext \
-out "./tmp/installer-arm64.msi" "./resources/standalone.wxs"
- name: Create universal installer
+ env:
+ VERSION_NUMBER: ${{ needs.next-version.outputs.new-release-version }}
run: |
wix build -arch "x64" -ext WixToolset.BootstrapperApplications.wixext \
-out "./tmp/installer-universal.exe" "./resources/bundle.wxs"
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index e18c7aa8..b704d932 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -5,7 +5,7 @@ on:
inputs:
draft-release:
type: boolean
- default: false
+ default: true
description: Whether to publish the release as a draft.
permissions:
@@ -17,11 +17,11 @@ concurrency:
group: release
jobs:
- build:
- uses: ./.github/workflows/build.yaml
+ package:
+ uses: ./.github/workflows/package.yaml
- pre-release:
- needs: build
+ release:
+ needs: [package]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -34,7 +34,8 @@ jobs:
name: installers
path: tmp/
- - uses: glzr-io/actions/semantic-release@main
+ - name: Semantic release
+ uses: glzr-io/actions/semantic-release@main
with:
gh-publish: true
gh-draft-release: ${{ inputs.draft-release }}