Skip to content

Commit 6d7295d

Browse files
committed
CI: Move releasing code to release trigger
This should be exciting
1 parent e4da961 commit 6d7295d

File tree

3 files changed

+63
-5
lines changed

3 files changed

+63
-5
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[.github/*.yml]
2+
indent_style = space
3+
indent_size = 2

.github/workflows/msbuild.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ name: MSBuild
88
on:
99
push:
1010
branches: [ "master" ]
11-
tags:
12-
- v.*
1311
pull_request:
1412
branches: [ "master" ]
1513

@@ -49,9 +47,6 @@ jobs:
4947
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
5048
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:VcsVersion=$(git describe --always) ${{env.SOLUTION_FILE_PATH}}
5149

52-
- name: Airports json
53-
run: Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mwgg/Airports/refs/heads/master/airports.json" -OutFile "Release/airports.json"
54-
5550
- name: Artifact
5651
uses: actions/upload-artifact@v4
5752
with:

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
- edited
8+
9+
env:
10+
# Path to the solution file relative to the root of the project.
11+
SOLUTION_FILE_PATH: .
12+
13+
# Configuration type to build.
14+
# You can convert this to a build matrix if you need coverage of multiple configuration types.
15+
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
16+
BUILD_CONFIGURATION: Release
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
runs-on: windows-latest
24+
25+
steps:
26+
- uses: actions/checkout@v5
27+
with:
28+
fetch-depth: 0 # Needed for git describe to work. Yes thats a lil silly
29+
fetch-tags: true
30+
filter: "tree:0"
31+
32+
- name: Add MSBuild to PATH
33+
uses: microsoft/setup-msbuild@v1.0.2
34+
35+
- name: Restore NuGet packages
36+
working-directory: ${{env.GITHUB_WORKSPACE}}
37+
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
38+
39+
- name: Build
40+
working-directory: ${{env.GITHUB_WORKSPACE}}
41+
# Add additional options to the MSBuild command line here (like platform or verbosity level).
42+
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
43+
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:VcsVersion=$(git describe --always) ${{env.SOLUTION_FILE_PATH}}
44+
45+
- name: Airports json
46+
run: Invoke-WebRequest -Uri "https://raw.githubusercontent.com/mwgg/Airports/refs/heads/master/airports.json" -OutFile "Release/airports.json"
47+
48+
- name: Artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: release
52+
path: Release/
53+
54+
- name: Compress
55+
run: Compress-Archive -Path .\Release\* -DestinationPath Release.zip
56+
57+
- name: Add to release
58+
env:
59+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
run: gh release upload $GITHUB_REF Release.zip --clobber

0 commit comments

Comments
 (0)