Skip to content

Commit

Permalink
.github: add ci actions
Browse files Browse the repository at this point in the history
Signed-off-by: James Knight <james.d.knight@live.com>
  • Loading branch information
jdknight committed Feb 18, 2024
1 parent fa42ccf commit 7af2844
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build

on:
push:
branches:
- main
paths:
- '.github/workflows/build.yml'
- 'scripts/**'
- 'src/**'
- 'CMakeLists.txt'
- '*.cmake'
pull_request:
branches:
- main
paths:
- '.github/workflows/build.yml'
- 'scripts/**'
- 'src/**'
- 'CMakeLists.txt'
- '*.cmake'
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir output
cd output
cmake ..
cmake --build .
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release
permissions: read-all

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Build release
run: |
mkdir output
cd output
cmake ..
cmake --build . --config Release
- name: Generate hashes
run: |
cd output/Release
sha256sum -b capsblock.exe >SHA256SUMS
cat SHA256SUMS
- name: Store release artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: output/Release/

draft-release:
name: Prepare GitHub Draft Release
runs-on: ubuntu-latest
environment: release
needs:
- build
permissions:
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Acquire release artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts
path: artifacts/

- name: Prepare GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release create --draft --verify-tag
'${{ github.ref_name }}' artifacts/**

0 comments on commit 7af2844

Please sign in to comment.