Merge pull request #7 from Gyurios/Gyu #342
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 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 | |
- 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 |