Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows From Main #8

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "monthly"
23 changes: 23 additions & 0 deletions .github/workflows/publish_commit_id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Publish commit id"

on:
push:
branches: [ master ]

jobs:
publish_id:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Publish commit id
uses: ParadoxGameConverters/publish_commit_id@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
destination_file: 'ba-to-imperator.txt'
user_email: '[email protected]'
user_name: 'idhrendur'
destination_branch: 'main'
commit_message: "Publish ba-to-imperator's commit id"
150 changes: 150 additions & 0 deletions .github/workflows/windows_build_test_and_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Build, test and publish
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build_local:
name: Build and publish local
if: github.repository_owner == 'ParadoxGameConverters'
runs-on: [ self-hosted, windows ]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: "Get previous tag"
if: ${{ github.event_name == 'push' }}
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: "Build converter sln"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\BaToImperator.sln -target:BaToImperator

- name: "Build converter jar"
run: |
cd $Env:GITHUB_WORKSPACE\BaToImperator
mvn package

- name: "Copy jar to Release directory"
run: |
cp BaToImperator/target/BaToImperator.jar Release/BaToImperator

- name: "Build converter executable"
run: |
cd $Env:GITHUB_WORKSPACE\BaToImperator
mvn -e -X clean verify

- name: "Copy backend to Release directory"
run: |
xcopy /y /r /s BaToImperator\target\jpackage\BaToImperator Release\BaToImperator\

- name: "Replace frontend background image"
run: |
rm Fronter.NET/Fronter.NET/Assets/Images/background.png
cp Resources/images/SteamMainImage.png Fronter.NET/Fronter.NET/Assets/Images/background.png

- name: "Build frontend"
uses: ./Fronter.NET/.github/actions/build_frontend
with:
fronter_dir: 'Fronter.NET'
release_dir: 'Release'

- name: "Prepare release zip"
if: ${{ github.event_name == 'push' }}
run: |
cd "C:\Program Files\7-Zip\"
.\7z.exe a $Env:GITHUB_WORKSPACE\BaToImperator-win-x64.zip $Env:GITHUB_WORKSPACE\Release\*
cp $Env:GITHUB_WORKSPACE\BaToImperator-win-x64.zip $Env:GITHUB_WORKSPACE\BaToImperator-latest.zip

- uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'push' }}
with:
path: Release/

- name: "Upload binary to current release"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.previoustag.outputs.tag }}
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: BaToImperator-win-x64.zip
token: ${{ secrets.API_TOKEN_GITHUB }}

- name: "Upload binary to latest release"
if: ${{ github.event_name == 'push' }}
uses: ncipollo/release-action@v1
with:
tag: latest
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: BaToImperator-latest.zip
token: ${{ secrets.API_TOKEN_GITHUB }}

- name: "Cleanup"
if: always()
run: |
Get-ChildItem -Path $Env:GITHUB_WORKSPACE -Recurse -Force | Remove-Item -force -recurse

build_foreign:
name: Build foreign
if: github.repository_owner != 'ParadoxGameConverters'
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: "Build converter sln"
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe -m -p:Configuration=Release $Env:GITHUB_WORKSPACE\BaToImperator.sln -target:BaToImperator

- name: "Build converter jar"
run: |
cd $Env:GITHUB_WORKSPACE\BaToImperator
mvn package

- name: "Copy jar to Release directory"
run: |
cp BaToImperator/target/BaToImperator.jar Release/BaToImperator

- name: "Build converter executable"
run: |
cd $Env:GITHUB_WORKSPACE\BaToImperator
mvn -e -X clean verify

- name: "Copy backend to Release directory"
run: |
xcopy /y /r /s BaToImperator\target\jpackage\BaToImperator Release\BaToImperator\

- name: "Replace frontend background image"
run: |
rm Fronter.NET/Fronter.NET/Assets/Images/background.png
cp Resources/images/SteamMainImage.png Fronter.NET/Fronter.NET/Assets/Images/background.png

- name: "Build frontend"
uses: ./Fronter.NET/.github/actions/build_frontend
with:
fronter_dir: 'Fronter.NET'
release_dir: 'Release'

- uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'push' }}
with:
path: Release/

Loading