-
Notifications
You must be signed in to change notification settings - Fork 225
72 lines (63 loc) · 1.85 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Nightly
on:
workflow_dispatch:
schedule:
- cron: "13 01 * * *"
permissions:
contents: write
actions: write
jobs:
check:
name: Pre-check
runs-on: 'ubuntu-latest'
steps:
- name: Get last run SHA
run: gh run list --limit 1 --workflow nightly.yml --json headSha --template "{{range .}}SHA={{.headSha}}{{end}}" --status completed --repo ${{ github.repository }} >> "$GITHUB_OUTPUT"
id: last_run
env:
GH_TOKEN: ${{ github.token }}
- name: Print
run: |
echo Last sha: ${{ steps.last_run.outputs.sha }}
echo Current: ${{ github.sha }}
echo Should cancel: ${{ steps.last_run.outputs.sha == github.sha }}
- if: ${{ steps.last_run.outputs.sha == github.sha }}
run: gh run cancel ${{ github.run_id }} --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}
build:
name: Build
needs: [check]
uses: ./.github/workflows/reusable-build.yml
strategy:
fail-fast: false
matrix:
architecture: [x64, x86]
with:
architecture: ${{ matrix.architecture }}
upload: true
docs: true
publish:
name: Package
needs: [build]
runs-on: windows-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Re-arrange artifacts
shell: cmd
run: |
dir /S /B
move Orbiter-x64\Orbiter.zip Orbiter-x64.zip
move Orbiter-x86\Orbiter.zip Orbiter-x86.zip
dir /S /B
- name: "Create nightly release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ github.token }}"
automatic_release_tag: "latest"
prerelease: true
title: "Orbiter development build"
files: |
Orbiter-x86.zip
Orbiter-x64.zip