Merge pull request #82 from Babel-TTT/sos-test #8
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 Trains | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.12 | |
# I wish there could be an Action for this. | |
- name: Install Scoop - setup - build | |
shell: pwsh | |
run: | | |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser | |
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression | |
scoop bucket add openttd https://github.com/WenSimEHRP/OpenTTD-Bucket | |
scoop install openttd/nml | |
scoop install openttd/gorender | |
make | |
gcc -E -x c tracks.pnml > tracks.nml | |
nmlc tracks.nml --grf=china-set-tracks.grf | |
- name: Get Date | |
id: date | |
shell: pwsh | |
run: echo "RELEASE_DATE=$(Get-Date -Format 'yyyy-MM-dd')" >> $env:GITHUB_ENV | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RELEASE_DATE }} | |
release_name: Release ${{ env.RELEASE_DATE }} | |
draft: false | |
prerelease: true | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./chinasettrains.grf | |
asset_name: chinasettrains.grf | |
asset_content_type: application/octet-stream |