v0.2.2 #49
Workflow file for this run
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 twipo-synchro | |
on: | |
push: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build-installer-win: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build installer | |
run: | | |
cargo build --release --target i686-pc-windows-msvc --bin installer | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer-windows-${{ github.sha }} | |
path: ./target/i686-pc-windows-msvc/release/installer.exe | |
build-installer-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install i686 target | |
run: | | |
rustup target add i686-unknown-linux-musl | |
- name: Build installer | |
run: | | |
cargo build --release --target i686-unknown-linux-musl --bin installer | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer-linux-${{ github.sha }} | |
path: ./target/i686-unknown-linux-musl/release/installer | |
build-lb: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/AppData/Roaming/vcpkg/archives | |
~/AppData/Local/vcpkg/archives | |
key: ${{ runner.os }}-vcpkg | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
- name: Build LanguageBarrier | |
run: | | |
cd LanguageBarrier | |
vcpkg install minhook cereal nlohmann-json freetype directxtex --triplet=x86-windows-static-md | |
vcpkg integrate install | |
msbuild /p:"Configuration=dinput8-Release;VcpkgUserTriplet=x86-windows-static-md;VcpkgUseStatic=false" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lb-${{ github.sha }} | |
path: ./LanguageBarrier/dinput8-Release/dinput8.dll | |
build-server: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build server | |
run: | | |
cargo build --release --target i686-pc-windows-msvc --bin twipo-synchro | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-${{ github.sha }} | |
path: ./target/i686-pc-windows-msvc/release/twipo-synchro.exe | |
generate-about: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-about | |
- name: Install cargo-about | |
continue-on-error: true | |
run: | | |
cargo install cargo-about | |
- name: Generate third party license file for the server | |
run: | | |
cargo about generate about.hbs > thirdparty.LICENSE.md | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: about-${{ github.sha }} | |
path: ./thirdparty.LICENSE.md | |
pack-dist: | |
runs-on: windows-latest | |
needs: [build-installer-win, build-installer-linux, build-lb, build-server, generate-about] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Prepare dist | |
run: | | |
mkdir "dist" | |
mkdir "dist/twipo-synchro" | |
mkdir "dist/NOTES ELITE" | |
copy "installer-windows-${{ github.sha }}/installer.exe" "dist/installer-win.exe" | |
copy "installer-linux-${{ github.sha }}/installer" "dist/installer-linux" | |
copy "README.md" "dist/" | |
copy "server-${{ github.sha }}/twipo-synchro.exe" "dist/twipo-synchro" | |
copy "LICENSE" "dist/twipo-synchro" | |
copy "res/charset.LICENSE.md" "dist/twipo-synchro" | |
copy "about-${{ github.sha }}/thirdparty.LICENSE.md" "dist/twipo-synchro" | |
copy "lb-${{ github.sha }}/dinput8.dll" "dist/NOTES ELITE" | |
copy "LanguageBarrier/LanguageBarrier/LICENSE" "dist/NOTES ELITE" | |
copy "LanguageBarrier/LanguageBarrier/THIRDPARTY.LB.txt" "dist/NOTES ELITE" | |
- name: Create dist zip | |
run: | | |
mv dist "twipo-synchro-${{ github.ref_name }}" | |
Compress-Archive -Path "twipo-synchro-${{ github.ref_name }}" -DestinationPath "twipo-synchro-${{ github.ref_name }}.zip" | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "twipo-synchro-${{ github.sha }}" | |
path: "twipo-synchro-${{ github.ref_name }}" | |
- name: Update release | |
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'created') | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: "./twipo-synchro-${{ github.ref_name }}.zip" | |
asset_name: "twipo-synchro-${{ github.ref_name }}.zip" | |
asset_content_type: application/zip |