Skip to content

Commit

Permalink
Add: GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
WenSimEHRP committed Sep 5, 2024
1 parent fa6abcf commit 9374424
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ end_of_line = lf

[Makefile]
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Station

on:
push:
branches:
- master
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

- name: Install Scoop
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
- name: Install dependencies
shell: pwsh
run: |
scoop install just
just deps
- name: Build Tracks
run: just

- name: Pack Binaries
shell: pwsh
run: |
New-Item -ItemType Directory -Path release
Move-Item -Path china-set-tracks.grf -Destination release/
- 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: ./release/china-set-tracks.grf
asset_name: china-set-tracks.grf
asset_content_type: application/octet-stream
1 change: 0 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ deps:
scoop bucket add openttd-bucket https://github.com/wensimehrp/openttd-bucket
scoop install openttd-bucket/gorender
scoop install openttd-bucket/nml
scoop install mingw

clean_png_dir dir:
find ./vox/{{dir}} -name '*.png' -delete

0 comments on commit 9374424

Please sign in to comment.