Skip to content

Commit c7ac7ca

Browse files
authored
Merge pull request #471 from DarkWanderer/main
Workflow refactoring & new release workflow
2 parents 1a23dad + 4f95aed commit c7ac7ca

File tree

4 files changed

+177
-76
lines changed

4 files changed

+177
-76
lines changed

.github/workflows/nightly.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Nightly
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "13 01 * * *"
7+
8+
permissions:
9+
contents: write
10+
actions: read
11+
12+
jobs:
13+
build:
14+
name: Build
15+
uses: ./.github/workflows/reusable-build.yml
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
architecture: [x64, x86]
20+
with:
21+
architecture: ${{ matrix.architecture }}
22+
upload: true
23+
24+
publish:
25+
name: Package
26+
needs: [build, build]
27+
runs-on: windows-latest
28+
steps:
29+
- name: Download artifacts
30+
uses: actions/download-artifact@v4
31+
32+
- name: Re-arrange artifacts
33+
shell: cmd
34+
run: |
35+
dir /S /B
36+
move Orbiter-x64\Orbiter.zip Orbiter-x64.zip
37+
move Orbiter-x86\Orbiter.zip Orbiter-x86.zip
38+
dir /S /B
39+
40+
- name: "Create nightly release"
41+
uses: "marvinpinto/action-automatic-releases@latest"
42+
with:
43+
repo_token: "${{ github.token }}"
44+
automatic_release_tag: "latest"
45+
prerelease: true
46+
title: "Orbiter development build"
47+
files: |
48+
Orbiter-x86.zip
49+
Orbiter-x64.zip

.github/workflows/on-push.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: On Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore: [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
8+
pull_request:
9+
branches:
10+
- main
11+
paths-ignore: [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
12+
13+
jobs:
14+
build:
15+
name: Push
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
architecture: [x64, x86]
20+
os: [windows-2019, windows-2022] # Why do we need multiple Windows versions?
21+
uses: ./.github/workflows/reusable-build.yml
22+
with:
23+
os: ${{ matrix.os }}
24+
architecture: ${{ matrix.architecture }}

.github/workflows/release.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
default: 2024.1.0
10+
11+
run-name: Release ${{ inputs.version }}
12+
13+
permissions:
14+
actions: read
15+
contents: write
16+
17+
env:
18+
artifact-name: Orbiter-${{ inputs.version }}.zip
19+
20+
jobs:
21+
build:
22+
name: Build
23+
uses: ./.github/workflows/reusable-build.yml
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
architecture: [x64, x86]
28+
with:
29+
architecture: ${{ matrix.architecture }}
30+
upload: true
31+
32+
package:
33+
name: Package
34+
needs: [build]
35+
runs-on: ubuntu-latest
36+
permissions:
37+
actions: read
38+
contents: write
39+
steps:
40+
- uses: actions/download-artifact@v4
41+
with:
42+
name: Orbiter-x86
43+
path: Orbiter-x86
44+
45+
- uses: actions/download-artifact@v4
46+
with:
47+
name: Orbiter-x64
48+
path: Orbiter-x64
49+
50+
- run: |
51+
find .
52+
mv Orbiter-x86/Orbiter.zip Orbiter-x86.zip
53+
mv Orbiter-x64/Orbiter.zip Orbiter-x64.zip
54+
55+
- name: "Create nightly release"
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
body: https://orbiter.voron.software/downloads/Orbiter-${{ inputs.version }}.zip
59+
tag_name: ${{ inputs.version }}
60+
prerelease: false
61+
make_latest: true
62+
target_commitish: ${{ github.sha }}
63+
name: Orbiter ${{ inputs.version }}
64+
files: |
65+
Orbiter-x86.zip
66+
Orbiter-x64.zip
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
name: Build
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
paths-ignore: [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
8-
pull_request:
9-
branches:
10-
- main
11-
paths-ignore: [ 'Doc/**', 'Flights/**', 'Html/**', 'Images/**', 'Localdoc/**', 'Scenarios/**', 'Textures/**', 'Textures2/**']
4+
workflow_call:
5+
inputs:
6+
os:
7+
default: windows-2019
8+
type: string
9+
architecture:
10+
description: 'Build Architecture'
11+
default: x86
12+
type: string
13+
upload:
14+
description: Upload resulting artifact?
15+
type: boolean
16+
default: false
17+
18+
run-name: Build ${{ inputs.architecture }} on ${{ inputs.os }}
19+
20+
permissions:
21+
contents: read
1222

1323
jobs:
1424
build:
1525
name: Build
26+
runs-on: ${{ inputs.os }}
1627

1728
env:
1829
DXSDK_DIR: "${{ github.workspace }}\\DXSDK"
1930

20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
architecture: [x64, x86]
24-
os: [windows-2019, windows-2022]
25-
26-
runs-on: ${{ matrix.os }}
27-
2831
steps:
2932
- name: Checkout
3033
uses: actions/checkout@v4
@@ -37,7 +40,7 @@ jobs:
3740
- name: Setup MSVC Console
3841
uses: ilammy/msvc-dev-cmd@v1
3942
with:
40-
arch: ${{ matrix.architecture }}
43+
arch: ${{ inputs.architecture }}
4144

4245
- name: Create directories
4346
run: |
@@ -47,8 +50,8 @@ jobs:
4750
- name: Cache irrKlang package
4851
uses: actions/cache@v4
4952
with:
50-
path: ${{ github.workspace }}/Extern/irrKlang/${{ matrix.architecture }}
51-
key: irrKlang-${{ matrix.architecture }}
53+
path: ${{ github.workspace }}/Extern/irrKlang/${{ inputs.architecture }}
54+
key: irrKlang-${{ inputs.architecture }}
5255

5356
- name: Cache DirectX SDK
5457
id: cache
@@ -68,16 +71,16 @@ jobs:
6871
dir /S /B DXSDK
6972
7073
- name: Configure
71-
run: cmake . --preset windows-${{ matrix.architecture }}-release -DORBITER_MAKE_DOC=OFF -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"
74+
run: cmake . --preset windows-${{ inputs.architecture }}-release -DORBITER_MAKE_DOC=OFF -DDXSDK_DIR:PATH="${{ github.workspace }}\\DXSDK"
7275

7376
- name: Build
74-
run: cmake --build --preset windows-${{ matrix.architecture }}-release --jobs 2
77+
run: cmake --build --preset windows-${{ inputs.architecture }}-release --jobs 2
7578

7679
- name: Test
77-
run: ctest --preset windows-${{ matrix.architecture }}-release --jobs 2
80+
run: ctest --preset windows-${{ inputs.architecture }}-release --parallel 2
7881

7982
- name: Install
80-
working-directory: ${{ github.workspace }}/out/build/windows-${{ matrix.architecture }}-release
83+
working-directory: ${{ github.workspace }}/out/build/windows-${{ inputs.architecture }}-release
8184
run: cmake --install . --prefix ${{ github.workspace }}/out/install
8285

8386
- name: List exports
@@ -91,71 +94,30 @@ jobs:
9194
del /Q exports_tmp*.txt
9295
9396
- name: Diff exports with Orbiter 2016
94-
if: ${{ matrix.architecture == 'x86' }}
97+
if: ${{ inputs.architecture == 'x86' }}
9598
shell: cmd
9699
continue-on-error: true
97100
run: git diff -U0 --ignore-cr-at-eol --ignore-space-at-eol --no-index exports.2016.txt out/install/Orbiter/exports.txt
98101

99-
- name: Upload exports
100-
if: ${{ matrix.os == 'windows-2019' }}
101-
uses: actions/upload-artifact@v4
102-
with:
103-
name: exports-${{ matrix.architecture }}
104-
path: ${{ github.workspace }}/out/install/Orbiter/exports.txt
105-
retention-days: 1
106-
107102
- name: Pack
108103
if: ${{ github.ref == 'refs/heads/main' }}
109104
working-directory: ${{ github.workspace }}/out/install/Orbiter
110105
shell: cmd
111106
run: '7z a "${{ github.workspace }}/out/Orbiter.zip" .'
112107

108+
- name: Upload exports
109+
if: inputs.upload
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: exports-${{ inputs.architecture }}
113+
path: ${{ github.workspace }}/out/install/Orbiter/exports.txt
114+
retention-days: 1
115+
113116
- name: Upload Build Artifact
114-
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'windows-2019' }}
115117
uses: actions/upload-artifact@v4
118+
if: inputs.upload
116119
with:
117-
name: Orbiter-${{ matrix.architecture }}
120+
name: Orbiter-${{ inputs.architecture }}
118121
# A file, directory or wildcard pattern that describes what to upload
119122
path: ${{ github.workspace }}/out/Orbiter.zip
120-
retention-days: 60
121-
122-
pre-release:
123-
name: Publish pre-release
124-
125-
needs: build
126-
127-
runs-on: ubuntu-latest
128-
129-
if: ${{ github.ref == 'refs/heads/main' }}
130-
131-
steps:
132-
- name: Create directories
133-
run: mkdir out
134-
135-
- name: Checkout
136-
uses: actions/checkout@v4
137-
138-
- name: Download artifacts
139-
uses: actions/download-artifact@v4
140-
with:
141-
path: ./out
142-
143-
- name: Re-arrange artifacts
144-
run: |
145-
mv ./Orbiter-x64/Orbiter.zip ./Orbiter-x64.zip
146-
mv ./Orbiter-x86/Orbiter.zip ./Orbiter-x86.zip
147-
rmdir Orbiter-x64
148-
rmdir Orbiter-x86
149-
ls -R
150-
working-directory: ./out
151-
152-
- name: "Push pre-release tag and upload packages"
153-
uses: "marvinpinto/action-automatic-releases@latest"
154-
with:
155-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
156-
automatic_release_tag: "latest"
157-
prerelease: true
158-
title: "Orbiter development build"
159-
files: |
160-
./out/Orbiter-x86.zip
161-
./out/Orbiter-x64.zip
123+
retention-days: 1

0 commit comments

Comments
 (0)