Skip to content

Commit

Permalink
add github ci
Browse files Browse the repository at this point in the history
diff --git a/.editorconfig b/.editorconfig
index fb0fd86..97376cf 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,4 +7,10 @@ root = true
 indent_style = space
 indent_size = 4
 charset = utf-8
-end_of_line = crlf
\ No newline at end of file
+end_of_line = crlf
+
+[*.yml]
+indent_size = 2
+
+[*.json]
+indent_size = 2
\ No newline at end of file
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..940c0a7
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,46 @@
+name: Build and publish
+
+# run on pushes to master OR on version tag creation
+on:
+  push:
+    branches:
+      - master
+    tags:
+      - v*
+
+jobs:
+  build:
+    runs-on: windows-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Install CMake
+        uses: lukka/get-cmake@latest
+
+      - name: Build
+        uses: lukka/run-cmake@v10
+        with:
+          configurePreset: x64-windows
+          buildPreset: Release
+
+      - name: Publish release (version tag)
+        if: startsWith(github.ref, 'refs/tags/v')
+        uses: marvinpinto/action-automatic-releases@latest
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          prerelease: false
+          files: |
+            build/bin/Release/*.exe
+
+      - name: Publish pre-release (push to master)
+        if: github.ref == 'refs/heads/master'
+        uses: marvinpinto/action-automatic-releases@latest
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          automatic_release_tag: latest
+          title: Development build
+          prerelease: true
+          draft: true
+          files: |
+            build/bin/Release/*.exe
\ No newline at end of file
diff --git a/CMakePresets.json b/CMakePresets.json
new file mode 100644
index 0000000..0da06fa
--- /dev/null
+++ b/CMakePresets.json
@@ -0,0 +1,26 @@
+{
+  "version": 6,
+  "cmakeMinimumRequired": {
+    "major": 3,
+    "minor": 15,
+    "patch": 0
+  },
+  "configurePresets": [
+    {
+      "name": "x64-windows",
+      "binaryDir": "${sourceDir}/build",
+      "generator": "Visual Studio 17 2022",
+      "architecture": {
+        "value": "x64",
+        "strategy": "set"
+      }
+    }
+  ],
+  "buildPresets": [
+    {
+      "name": "Release",
+      "configurePreset": "x64-windows",
+      "configuration": "Release"
+    }
+  ]
+}
\ No newline at end of file
  • Loading branch information
dumbasPL committed Sep 29, 2023
1 parent 146feb1 commit 89f1c9d
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ root = true
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = crlf
end_of_line = crlf

[*.yml]
indent_size = 2

[*.json]
indent_size = 2
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and publish

# run on pushes to master OR on version tag creation
on:
push:
branches:
- master
tags:
- v*

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

- name: Install CMake
uses: lukka/get-cmake@latest

- name: Build
uses: lukka/run-cmake@v10
with:
configurePreset: x64-windows
buildPreset: Release

- name: Publish release (version tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
files: |
build/bin/Release/*.exe
- name: Publish pre-release (push to master)
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
title: Development build
prerelease: true
draft: true
files: |
build/bin/Release/*.exe
26 changes: 26 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 15,
"patch": 0
},
"configurePresets": [
{
"name": "x64-windows",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 17 2022",
"architecture": {
"value": "x64",
"strategy": "set"
}
}
],
"buildPresets": [
{
"name": "Release",
"configurePreset": "x64-windows",
"configuration": "Release"
}
]
}

0 comments on commit 89f1c9d

Please sign in to comment.