@@ -2,62 +2,51 @@ name: Handle Pull Request
22on :
33 pull_request :
44 types : [opened, ready_for_review]
5-
5+
66env :
7- SITU_OWNER : ' ronyan'
8- SITU_REPOSITORY : ' VATCANSitu'
7+ SITU_OWNER : " ronyan"
8+ SITU_REPOSITORY : " VATCANSitu"
99
1010jobs :
11- add-reviewers :
12- name : " 🤖 Auto assign PR reviewers"
13- runs-on : ubuntu-latest
14-
15- steps :
16- - name : " Assign 'sector-file-team' to PR"
17- uses : rowi1de/auto-assign-review-teams@v1.1.3
18- with :
19- repo-token : ${{ secrets.REVIEW_TOKEN }}
20- teams : " sector-file-team"
21-
2211 prepare :
2312 name : " 🏗️ Prepare"
2413 runs-on : ubuntu-latest
2514
2615 steps :
27- - uses : actions/checkout@v2
16+ - uses : actions/checkout@v4
2817
2918 - name : Get latest AeroNav data provider
3019 run : curl -s http://files.aero-nav.com/AeroNav_CZWG_by_Aerosoft_NavDataPro.txt | grep -A3 'SECTOR_NAME:CZWG NAV_Data' > SectorProvider.txt
3120
3221 - id : variables
3322 name : Export variables
3423 run : |
35- echo "::set-output name= data_url:: $( sed -n 's/SECTOR_URL://p' SectorProvider.txt )"
36- echo "::set-output name= airac_version:: $( grep -Po '(?<=SECTOR_VERSION:([0-9]{14})-).[[:digit:]]+(?=-)' SectorProvider.txt | cut -c 1-4 )"
37- echo "::set-output name= airac_update_version:: $( grep -Po '(?<=SECTOR_VERSION:([0-9]{14})-).[[:digit:]]+(?=-)' SectorProvider.txt | cut -c 5-6 )"
24+ echo "data_url= $( sed -n 's/SECTOR_URL://p' SectorProvider.txt )" >> $GITHUB_ENV
25+ echo "airac_version= $( grep -Po '(?<=SECTOR_VERSION:([0-9]{14})-).[[:digit:]]+(?=-)' SectorProvider.txt | cut -c 1-4 )" >> $GITHUB_ENV
26+ echo "airac_update_version= $( grep -Po '(?<=SECTOR_VERSION:([0-9]{14})-).[[:digit:]]+(?=-)' SectorProvider.txt | cut -c 5-6 )" >> $GITHUB_ENV
3827
39- echo "::set-output name= situ_urls:: $( cd $GITHUB_WORKSPACE/.github/workflows && python3 -c 'import os; import functions; print(functions.get_latest_release_download(os.environ["SITU_OWNER"], os.environ["SITU_REPOSITORY"]))' )"
28+ echo "situ_urls= $( cd $GITHUB_WORKSPACE/.github/workflows && python3 -c 'import os; import functions; print(functions.get_latest_release_download(os.environ["SITU_OWNER"], os.environ["SITU_REPOSITORY"]))' )" >> $GITHUB_ENV
4029
4130 outputs :
42- release_tag : PR-TESTING
31+ release_tag : ${{ steps.tag-name.outputs.tag }}
4332
44- data_url : ${{ steps.variables.outputs .data_url }}
45- airac_version : ${{ steps.variables.outputs .airac_version }}
46- airac_update_version : ${{ steps.variables.outputs .airac_update_version }}
47- situ_urls : ${{ steps.variables.outputs .situ_urls }}
33+ data_url : ${{ env .data_url }}
34+ airac_version : ${{ env .airac_version }}
35+ airac_update_version : ${{ env .airac_update_version }}
36+ situ_urls : ${{ env .situ_urls }}
4837
4938 update-navdata :
5039 name : " 🔃 Update NavData"
5140 needs : prepare
5241 runs-on : ubuntu-latest
5342
5443 steps :
55- - uses : actions/checkout@v2
44+ - uses : actions/checkout@v4
5645
5746 - name : Download and extract sector data
5847 run : |
5948 curl -s -H "User-Agent: EuroScope" -o temp.7z ${{ needs.prepare.outputs.data_url }}
60- 7z x temp.7z -y -o/tmp/sector-data >> /dev/null
49+ 7z x temp.7z -y -o /tmp/sector-data
6150 rm temp.7z
6251
6352 - name : Update NavData folder
6655 cp -TR /tmp/sector-data/CZWG/NavData CZWG/NavData
6756
6857 - name : Prepare and insert new data
69- run : |
58+ run : |
7059 # Update .sct file
7160 sed -n "/\[VOR\]/,/^\s*$/p" /tmp/sector-data/*.sct >> *.sct
7261 sed -n "/\[NDB\]/,/^\s*$/p" /tmp/sector-data/*.sct >> *.sct
8170 gawk -i inplace '/\[INFO\]/{ n=NR+1 } NR==n{ $0="CZWG ${{ needs.prepare.outputs.airac_version }} ${{ needs.prepare.outputs.release_tag }}" }1' *.sct
8271
8372 - name : Upload sector data
84- uses : actions/upload-artifact@v2
73+ uses : actions/upload-artifact@v4
8574 with :
8675 name : sector-data
8776 path : |
9483 needs : prepare
9584
9685 steps :
97- - uses : actions/checkout@v2
86+ - uses : actions/checkout@v4
9887
9988 - name : Get latest release
10089 working-directory : ${{ runner.temp }}
@@ -103,15 +92,15 @@ jobs:
10392 mv *.dll VATCANSitu-latest.dll
10493
10594 - name : Upload artifact
106- uses : actions/upload-artifact@v2
95+ uses : actions/upload-artifact@v4
10796 with :
10897 name : vatcan-situ-latest
10998 path : ${{ runner.temp }}/VATCANSitu-latest.dll
11099
111100 package :
112101 name : " 📦 Package"
113102 if : ${{ always() && needs.update-navdata.result != 'failure' && needs.latest-situ-release.result != 'failure' }}
114- needs : [ prepare, update-navdata, latest-situ-release ]
103+ needs : [prepare, update-navdata, latest-situ-release]
115104 runs-on : ubuntu-latest
116105
117106 env :
@@ -120,15 +109,15 @@ jobs:
120109 RELEASE_TAG : ${{ needs.prepare.outputs.release_tag}}
121110
122111 steps :
123- - uses : actions/checkout@v2
112+ - uses : actions/checkout@v4
124113
125114 - name : Get sector data
126- uses : actions/download-artifact@v2
115+ uses : actions/download-artifact@v4
127116 with :
128117 name : sector-data
129118
130119 - name : Get latest VATCAN Situ
131- uses : actions/download-artifact@v2
120+ uses : actions/download-artifact@v4
132121 with :
133122 name : vatcan-situ-latest
134123 path : CZWG\Plugins
@@ -139,31 +128,31 @@ jobs:
139128 rm -rf .github
140129
141130 - name : Compress files
142- env :
131+ env :
143132 VERSION : ${{ env.AIRAC_VERSION }}_${{ env.AIRAC_UPDATE_VERSION }}_${{ env.RELEASE_TAG }}
144133 run : |
145134 mv *.ese CZWG_Full_"$VERSION".ese && mv *.sct CZWG_Full_"$VERSION".sct
146-
135+
147136 # Insert 'sector' line into profile
148137 sed -i "1s/^/Settings sector \\CZWG_Full_$VERSION.sct\n/" *.prf
149-
138+
150139 zip -r ${{ runner.temp }}/CZWG_Full_"$VERSION".zip .
151-
140+
152141 - name : Upload workflow artifact
153- uses : actions/upload-artifact@v2
142+ uses : actions/upload-artifact@v4
154143 with :
155144 name : Testing File
156145 path : ${{ runner.temp }}/CZWG_Full_${{ env.AIRAC_VERSION }}_${{ env.AIRAC_UPDATE_VERSION }}_${{ env.RELEASE_TAG }}.zip
157146
158147 cleanup :
159148 name : " 🧹 Cleanup"
160149 if : ${{ always() }}
161- needs : [ package ]
150+ needs : [package]
162151 runs-on : ubuntu-latest
163152
164153 steps :
165154 - name : Clean artifacts
166- uses : geekyeggo/delete-artifact@v1
155+ uses : geekyeggo/delete-artifact@v5
167156 with :
168157 name : |
169158 sector-data
0 commit comments