Skip to content

fix ci

fix ci #2

Workflow file for this run

name: GLSMAC autobuild
on:
push:
branches: [ "main" ]
# branches: [ "stable" ]
pull_request:
branches: [ "main" ]
# branches: [ "stable" ]
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
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 }}
# - 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: |
mkdir build-linux64
- name: cmake
working-directory: ./build-linux64
run: cmake -DCMAKE_BUILD_TYPE=Portable64 ..
- name: make64
working-directory: ./build-linux64
run: make
- name: data64
working-directory: ./build-linux64
run: cp -R GLSMAC_data bin/
- name: pack64
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-linux64-bin
path: |
./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:
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: ${{ 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