Skip to content

Commit

Permalink
ci: add automated releases (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger authored Dec 29, 2023
1 parent e9474dd commit f6f1833
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 104 deletions.
39 changes: 39 additions & 0 deletions .github/actions/release-with-artifacts/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release with artifacts

inputs:
is-prerelease:
required: true

runs:
using: composite
steps:
- name: Download artifacts (win-x64)
uses: actions/download-artifact@v4
with:
name: glazewm-win-x64-${{ github.sha }}
path: artifacts/win-x64

- name: Download artifacts (win-x86)
uses: actions/download-artifact@v4
with:
name: glazewm-win-x86-${{ github.sha }}
path: artifacts/win-x86

- uses: glzr-io/actions/semantic-release@main
with:
is-prerelease: ${{ inputs.is-prerelease }}
prerelease_tag: nightly
gh-publish: true
gh-draft-release: ${{ !inputs.is-prerelease }}
gh-token: ${{ github.token }}
gh-assets: |
[
{
"path": "artifacts/win-x64/GlazeWM.exe",
"name": "GlazeWM_x64_${nextRelease.gitTag}"
},
{
"path": "artifacts/win-x86/GlazeWM.exe",
"name": "GlazeWM_x86_${nextRelease.gitTag}"
}
]
57 changes: 0 additions & 57 deletions .github/linters/.yaml-lint.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on:
workflow_call:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
runtime: [win-x64, win-x86]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- run: >
dotnet publish GlazeWM.App/GlazeWM.App.csproj
--configuration Release
--runtime ${{ matrix.runtime }}
--output GlazeWM.App/publish/
--self-contained
-p:PublishSingleFile=true
-p:IncludeAllContentForSelfExtract=true
- uses: actions/upload-artifact@v4
with:
name: glazewm-${{ matrix.runtime }}-${{ github.sha }}
path: GlazeWM.App/publish/GlazeWM.exe
if-no-files-found: error
15 changes: 15 additions & 0 deletions .github/workflows/lint-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint check

on: push

jobs:
lint-check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- run: dotnet format --verify-no-changes
13 changes: 13 additions & 0 deletions .github/workflows/pr-title-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR title check

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
pr-title-check:
runs-on: ubuntu-latest
steps:
- uses: glzr-io/actions/semantic-prs@main
with:
gh-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pre-release

on:
push:
branches: [main]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
uses: ./.github/workflows/build.yaml

pre-release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/release-with-artifacts
with:
is-prerelease: true
23 changes: 0 additions & 23 deletions .github/workflows/pull-request-linter.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/push-linter.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on: workflow_dispatch

permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
uses: ./.github/workflows/build.yaml

pre-release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/release-with-artifacts
with:
is-prerelease: false

0 comments on commit f6f1833

Please sign in to comment.