Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
afwbkbc committed Jul 7, 2024
1 parent cdf1651 commit c780497
Showing 1 changed file with 133 additions and 35 deletions.
168 changes: 133 additions & 35 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: C/C++ CI
name: GLSMAC autobuild

on:
push:
Expand All @@ -9,10 +9,10 @@ on:
# branches: [ "stable" ]

jobs:
build:

runs-on: windows-latest

prepare:
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/short-sha@v2.1
Expand All @@ -22,51 +22,149 @@ jobs:
- run: echo $SHA
env:
SHA: ${{ steps.short-sha.outputs.sha }}
# - uses: dev-drprasad/delete-older-releases@v0.2.0
# with:
# keep_latest: 4
# delete_tags: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v0.3-${{ env.SHA }}
release_name: v0.3-${{ env.SHA }}
draft: false
prerelease: false


build_linux64:
needs: [prepare]
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@v3
# - uses: benjlevesque/short-sha@v2.1
# id: short-sha
# with:
# length: 7
# - run: echo $SHA
# env:
# SHA: ${{ steps.short-sha.outputs.sha }}
- name: install_dependencies
run: |
sudo apt-get update
sudo apt-get install libfreetype-dev libsdl2-dev libsdl2-image-dev libglu-dev libglew-dev libossp-uuid-dev libyaml-cpp-dev
- name: prepare
run: |
choco install ninja
mkdir build
- name: cmake64
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Portable64 -DVENDORED_DEPENDENCIES=1 ..
working-directory: ./build
mkdir build-linux64
- name: cmake
working-directory: ./build-linux64
run: cmake -DCMAKE_BUILD_TYPE=Portable64 ..
- name: make64
working-directory: ./build
run: ninja
working-directory: ./build-linux64
run: make
- name: data64
working-directory: ./build
run: mv ../GLSMAC_data bin/
working-directory: ./build-linux64
run: cp -R GLSMAC_data bin/
- name: pack64
working-directory: ./build
run: tar -C bin -zcvf GLSMAC-v0.3-win64-${{ env.SHA }}-bin64.tar.gz GLSMAC.exe GLSMAC_data
working-directory: ./build-linux64
run: tar -C bin -zcvf GLSMAC.tar.gz GLSMAC GLSMAC_data
- name: publish
uses: actions/upload-artifact@v3
with:
name: GLSMAC-win64-bin
name: GLSMAC-linux64-bin
path: |
./build/GLSMAC-v0.3-win64-${{ env.SHA }}-bin64.tar.gz
- uses: dev-drprasad/delete-older-releases@v0.2.0
with:
keep_latest: 4
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
./build-linux64/GLSMAC.tar.gz
# - uses: dev-drprasad/delete-older-releases@v0.2.0
# with:
# keep_latest: 4
# delete_tags: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v0.3-${{ env.SHA }}
# release_name: v0.3-${{ env.SHA }}
# draft: false
# prerelease: false
- name: upload
# id: upload-release-asset-64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v0.3-win64-${{ env.SHA }}
release_name: v0.3-win64-${{ env.SHA }}
draft: false
prerelease: false
- name: Upload Release Asset 64
id: upload-release-asset-64
upload_url: ${{ needs.prepare.outputs.upload_url }}
asset_path: ./build-linux64/GLSMAC.tar.gz
asset_name: GLSMAC-v0.3-linux64-${{ env.SHA }}.tar.gz
asset_content_type: application/gzip


build_windows:

runs-on: windows-latest

steps:
# - uses: actions/checkout@v3
# - uses: benjlevesque/short-sha@v2.1
# id: short-sha
# with:
# length: 7
# - run: echo $SHA
# env:
# SHA: ${{ steps.short-sha.outputs.sha }}
- name: install_dependencies
run: |
choco install ninja
- name: prepare
run: |
mkdir build-windows64
- name: cmake
working-directory: ./build-windows64
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Portable64 -DVENDORED_DEPENDENCIES=1 ..
- name: make
working-directory: ./build-windows64
run: ninja
- name: data
working-directory: ./build-windows64
run: mv ../GLSMAC_data bin/
- name: pack
working-directory: ./build-windows64
run: tar -C bin -zcvf GLSMAC.tar.gz GLSMAC.exe GLSMAC_data
- name: publish
uses: actions/upload-artifact@v3
with:
name: GLSMAC-windows64-bin
path: |
./build-windows64/GLSMAC.tar.gz
# - uses: dev-drprasad/delete-older-releases@v0.2.0
# with:
# keep_latest: 4
# delete_tags: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v0.3-win64-${{ env.SHA }}
# release_name: v0.3-win64-${{ env.SHA }}
# draft: false
# prerelease: false
- name: upload
# id: upload-release-asset-64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/GLSMAC-v0.3-win64-${{ env.SHA }}-bin64.tar.gz
asset_name: GLSMAC-v0.3-win64-${{ env.SHA }}-bin64.tar.gz
upload_url: ${{ needs.prepare.outputs.upload_url }}
asset_path: ./build-windows64/GLSMAC.tar.gz
asset_name: GLSMAC-v0.3-windows64-${{ env.SHA }}.tar.gz
asset_content_type: application/gzip

0 comments on commit c780497

Please sign in to comment.