-
Notifications
You must be signed in to change notification settings - Fork 5
161 lines (137 loc) · 6.17 KB
/
build-general.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: build-general
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Generate version string
run: VERSION_STRING=`date +"1.%Y%m%d.1%H%M%S"` && echo "VERSION_STRING=$VERSION_STRING" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: node predownload.js
- run: node index.js
- name: Generate Euroscope Sector File Provider
run: |
echo "EuroScope Sector File Provider File" > VATKOR_Sector.txt
echo "" >> VATKOR_Sector.txt
echo "NAME:VATSIM Korea Sector File - Github" >> VATKOR_Sector.txt
echo "URL:https://github.com/lancard/korea-flight-database/releases/latest/download/VATKOR_Sector.txt" >> VATKOR_Sector.txt
echo "DOWNLOADINTERVAL:12" >> VATKOR_Sector.txt
echo "" >> VATKOR_Sector.txt
echo "" >> VATKOR_Sector.txt
echo "SECTOR_NAME:VATSIM Korea Sector File" >> VATKOR_Sector.txt
echo "SECTOR_FILE_NAME:sector" >> VATKOR_Sector.txt
echo "SECTOR_VERSION:${{ env.VERSION_STRING }}" >> VATKOR_Sector.txt
echo "SECTOR_URL:https://github.com/lancard/korea-flight-database/releases/latest/download/sector.7z" >> VATKOR_Sector.txt
- name: Copy All Resources for Euroscope Provider
run: |
cp vatsim/sector.ese ./sector_${{ env.VERSION_STRING }}.ese
cp vatsim/sector.sct2 ./sector_${{ env.VERSION_STRING }}.sct2
cp euroscope/ICAO_aircraft.txt ./ICAO_aircraft.txt
cp euroscope/ICAO_airline.txt ./ICAO_airline.txt
cp euroscope/ICAO_airport.txt ./ICAO_airport.txt
- uses: edgarrc/action-7z@v1
with:
args: 7z a -t7z -m0=BCJ -m1=LZMA:d=21 sector.7z sector_${{ env.VERSION_STRING }}.ese sector_${{ env.VERSION_STRING }}.sct2 ICAO_aircraft.txt ICAO_airline.txt ICAO_airport.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.VERSION_STRING }}
release_name: Release ${{ env.VERSION_STRING }}
draft: false
prerelease: false
- name: upload sector file provider file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: VATKOR_Sector.txt
asset_name: VATKOR_Sector.txt
asset_content_type: text/plain
- name: upload sector file for euroscope auto downloader
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: sector.7z
asset_name: sector.7z
asset_content_type: application/x-7z-compressed
- name: upload sector file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: vatsim/sector.sct2
asset_name: sector.sct2
asset_content_type: text/plain
- name: upload ese file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: vatsim/sector.ese
asset_name: sector.ese
asset_content_type: text/plain
- name: notify discord
# if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
curl -F 'payload_json={"content": "Sector change: ${{ github.event.head_commit.message }}"}' -F "file1=@vatsim/sector.sct2" ${{ secrets.DISCORD_WEBHOOK }}
- name: compress euroscope files
run: cd euroscope && zip settings.zip *
- name: upload euroscope zip file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: euroscope/settings.zip
asset_name: settings.zip
asset_content_type: application/zip
- name: upload openstreetmap file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: openstreetmap/data.sql
asset_name: data.sql
asset_content_type: text/plain
- name: upload etc files
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: etc/nuetrainer_sector.json
asset_name: nuetrainer_sector.json
asset_content_type: text/plain
- name: prepare pages
run: |
mkdir pages
mv database pages
mv vatsim/sector.sct2 pages
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './pages'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2