Skip to content

Commit 1f5f067

Browse files
committed
u
1 parent f52055f commit 1f5f067

File tree

4 files changed

+46
-59
lines changed

4 files changed

+46
-59
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ jobs:
2626
os: [windows-latest, ubuntu-latest]
2727

2828
steps:
29-
- uses: actions/checkout@v4
30-
with:
31-
submodules: true
29+
- name: Fetch sources
30+
uses: actions/checkout@v4
3231

3332
# Cache AUI boot directory
3433
- name: Cache AUI.BOOT deps
@@ -98,63 +97,39 @@ jobs:
9897
name: ${{ matrix.os }}
9998

10099

101-
release:
100+
release-draft:
102101
runs-on: ubuntu-latest
103102
permissions: write-all
104-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
105-
name: "Create release page"
103+
if: github.event_name != 'pull_request'
104+
needs: [ build-desktop ]
105+
name: "Release draft"
106106
steps:
107-
- name: Retrieve version
108-
if: ${{ contains(github.ref, 'tags/v') }}
109-
run: |
110-
echo "TAG_NAME=${{ github.ref }} " >> $GITHUB_ENV
111-
echo "RELEASE_NAME=${{ github.ref }} " >> $GITHUB_ENV
107+
- name: Fetch sources
108+
uses: actions/checkout@v4
112109

113-
- name: Output version
114-
id: version
110+
- name: Extract version
111+
run: |
112+
VERSION=$(grep -Po '[0-9\.]+ (?=# CI_PROJECT_VERSION)' CMakeLists.txt)
113+
echo "VERSION=$VERSION" >> $GITHUB_ENV
114+
echo "VERSION = $VERSION"
115+
116+
# Remove old release drafts
117+
- name: Remove Old Release Drafts
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115120
run: |
116-
echo "ref=$TAG_NAME" >> $GITHUB_OUTPUT
121+
gh api repos/{owner}/{repo}/releases \
122+
--jq '.[] | select(.draft == true) | .id' \
123+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
117124
118-
- name: Create Release
119-
id: create_release
120-
uses: actions/[email protected]
125+
- name: Create Release Draft
121126
env:
122127
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123-
with:
124-
tag_name: ${{ env.TAG_NAME }}
125-
release_name: ${{ env.RELEASE_NAME }}
126-
draft: false
127-
prerelease: true
128+
run: |
129+
gh release create "v${{ env.VERSION }}" \
130+
--draft \
131+
--title "v${{ env.VERSION }}"
132+
128133
outputs:
129134
upload_url: ${{ steps.create_release.outputs.upload_url }}
130135
ref: ${{ steps.version.outputs.ref }}
131-
132-
publish:
133-
name: Publish ${{ matrix.os }}
134-
runs-on: ubuntu-latest
135-
needs: [build-desktop, release]
136-
strategy:
137-
fail-fast: false
138-
matrix:
139-
os: [windows-latest, ubuntu-latest]
140-
141-
steps:
142-
- name: Download artifact
143-
uses: actions/download-artifact@v4
144-
with:
145-
path: ./
146-
name: ${{ matrix.os }}
147-
148-
- id: getfilename
149-
run: echo "::set-output name=file::$(ls *)"
150-
151-
- name: Upload to Release
152-
id: upload_to_release
153-
uses: actions/[email protected]
154-
env:
155-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156-
with:
157-
upload_url: ${{ needs.release.outputs.upload_url }}
158-
asset_path: ${{ steps.getfilename.outputs.file }}
159-
asset_name: ${{ steps.getfilename.outputs.file }}
160-
asset_content_type: application/x-gtar

.github/workflows/code-quality.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
name: Code Quality
22

33
on:
4-
push:
5-
branches:
6-
- master
74
pull_request:
85

96
concurrency:
107
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
118
cancel-in-progress: true
129

1310
env:
14-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1511
GIT_SUBMODULE_STRATEGY: recursive
1612

1713
permissions:

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Standard routine
22
cmake_minimum_required(VERSION 3.16)
3-
project(aui_app VERSION 0.0.1)
3+
project(aui_app
4+
VERSION 0.0.1 # CI_PROJECT_VERSION
5+
)
46

57
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
68

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ project.
99
The main goal of this template is to speed up the setup phase of application development for both new and experienced
1010
developers by preconfiguring the project scaffold and CI set up on GitHub.
1111

12+
This template features:
13+
- Building, testing, code quality checking and releasing with [GitHub Actions][gh:actions]
14+
- Application auto updating (Windows only)
15+
- AUI assets
16+
- Tests
17+
1218
# Getting Started
1319

1420
It is worth mentioning the benefits of using GitHub Templates. By created a new project using a template, you start with
1521
no history or reference to this repository.
1622

17-
1823
# Continuous Integration
1924

2025
In this project, continuous integration relies on [GitHub Actions][gh:actions], a set of workflows that enable
@@ -23,12 +28,21 @@ automation of building, testing and releasing process.
2328
In the `.github/workflows` directory, you can find definitions for the following GitHub Actions workflows:
2429
- [Build](.github/workflows/build.yml)
2530
- Triggered on `push` and `pull_request` events.
31+
- Builds the project for the supported platforms.
32+
- Runs Tests.
33+
- Generates installable packages.
34+
- Prepares a draft release of the GitHub Releases page for manual review.
2635
- [Code Quality](.github/workflows/code-quality.yml)
27-
- Triggered on `push` and `pull_request` events.
36+
- Triggered on `pull_request` events.
2837
- Performs `clang-tidy` checks (static analysis) and generates nice summary with `.github/tidy-summary.py`.
2938
- Performs `valgrind` checks on tests (dynamic analysis).
3039

3140

3241
# Code Quality and Formatting
3342

3443
The template includes `.clang-format` and `.clang-tidy`, the latter is used for code quality checks.
44+
45+
# Release Process
46+
47+
To create a release, simply push an update to version in `CMakeLists.txt`. Pipeline will create a GitHub Release Draft
48+
for you. After release draft is created, perform manual review and submit release.

0 commit comments

Comments
 (0)