forked from VATSIM-UK/UK-Sector-File
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.6 KB
/
compile.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
name: Compile and Validate
on:
push:
branches:
- '*'
- '**'
pull_request:
release:
types:
- published
jobs:
build:
name: "Compile Sectorfile"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Create Output Directory
run: mkdir .bin/
- name: Download Compiler
run: |
curl -L --output compiler https://github.com/VATSIM-UK/sector-file-compiler/releases/latest/download/cli-linux-x64
chmod +x ./compiler
- name: Set Build Version
run: echo "SECTORFILE_BUILD_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set Strip Comments
if: github.ref == 'refs/heads/main' || (github.event_name == 'release' && github.event.action == 'published')
run: echo "STRIP_COMMENTS=--strip-comments" >> $GITHUB_ENV
- name: Compile
run: |
./compiler --config-file compiler.config.json --strip-comments --no-wait --build-version $SECTORFILE_BUILD_VERSION $STRIP_COMMENTS
- name: Upload Build As Artifact
uses: actions/upload-artifact@v3
with:
name: UK Sector File
path: ".bin/UK.*"
- name: Trigger Workflow in UK Controller Pack
if: github.event_name == 'release' && github.event.action == 'published'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PUBLIC_PAT }}
repository: VATSIM-UK/uk-controller-pack
event-type: auto_airac_actions
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'