Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareGuy committed Sep 8, 2020
1 parent bed533d commit 2664b0a
Showing 1 changed file with 56 additions and 16 deletions.
72 changes: 56 additions & 16 deletions .github/workflows/Build-Master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,27 @@ on:
jobs:
create_release:
name: Prepare a new release
# Really?
runs-on: ubuntu-latest
outputs:
build_number: ${{ steps.buildnumber.outputs.build_number }}
create_release_url: ${{ steps.create_release.outputs.upload_url }}
create_release_url: ${{ steps.create_release.outputs.upload_url }}

steps:
- name: Generate a new build number.
id: buildnumber
uses: einaregilsson/build-number@v2
with:
token: ${{secrets.github_token}}

- name: Create release on repository
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: build-number-${{ steps.buildnumber.outputs.build_number }}
release_name: ENet Native Libraries (Autobuild ${{ steps.buildnumber.outputs.build_number }})
body: This is an automated build of the ENet native libraries, and is up to date with the latest commits. The attached per-platform archives contain ENet built in both production and debug environments.
tag_name: "autobuild-${{ github.run_number }}"
release_name: "ENet Native Libraries (Autobuild ${{ github.run_number }})"
body: "This is an automated build of the ENet native libraries, and is up to date with the latest commits. The attached per-platform archives contain ENet built in both production and debug environments."
draft: false
prerelease: false

# START LINUX BUILD JOB
build_linux64:
name: Prepare and build a Linux64 library.
name: Build for Linux x64
needs: create_release
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -103,15 +98,60 @@ jobs:
- name: Grab the latest copy of the repository.
uses: actions/checkout@v2

# Stubbed!
- name: Build Debug configuration Enet
run: |
mkdir ${{ runner.workspace }}\DebugOut
cd $GITHUB_WORKSPACE
dotnet clean
dotnet build
copy "${{ runner.workspace }}\Unity\Plugins\x86_64\enet.dll" "${{ runner.workspace }}\DebugOut"
cd "${{ runner.workspace }}\DebugOut"
Start-Process -NoNewWindow -FilePath "C:\Program Files\7-Zip\7z.exe" -ArgumentList "a Debug.zip enet.dll"
- name: Build Release configuration Enet
run: |
mkdir ${{ runner.workspace }}\ReleaseOut
cd $GITHUB_WORKSPACE
dotnet clean
dotnet build -c Release
copy "${{ runner.workspace }}\Unity\Plugins\x86_64\enet.dll" "${{ runner.workspace }}\ReleaseOut"
cd "${{ runner.workspace }}\ReleaseOut"
Start-Process -NoNewWindow -FilePath "C:\Program Files\7-Zip\7z.exe" -ArgumentList "a Release.zip enet.dll"
- name: Upload release library
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/ReleaseOut/Release.zip
asset_name: libenet-release-win64.zip
asset_content_type: application/zip

- name: Upload debug library
id: upload-debug-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/ReleaseTemp/Debug.zip
asset_name: libenet-debug-win64.zip
asset_content_type: application/zip
# END WINDOWS BUILD JOB

# START APPLE MACOS BUILD JOB
build_apple_64:
name: Build for MacOS
needs: create_release
runs-on: macos-latest
steps:
steps:
- name: Setup Xcode (with latest Apple SDK)
uses: maxim-lobanov/[email protected]
with:
xcode-version: 11.6

- name: Grab the latest copy of the repository.
uses: actions/checkout@v2

Expand All @@ -128,7 +168,7 @@ jobs:
- name: Setup Xcode (with latest Apple SDK)
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest
xcode-version: 11.6

- name: Grab the latest copy of the repository.
uses: actions/checkout@v2
Expand All @@ -143,7 +183,7 @@ jobs:
cd $GITHUB_WORKSPACE/Build-iOS ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
zip -j -9 ${{ runner.workspace }}/temp/Release/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Release-iphoneos/libenet.a
- name: Run iOS build script in Debug mode
- name: Run iOS build script in Debug mode.
run: |
cd $GITHUB_WORKSPACE/Build-iOS; sed -i '' 's/BUILD_TYPE="Release"/BUILD_TYPE="Debug"/g' Build-iOS.command ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
zip -j -9 ${{ runner.workspace }}/temp/Debug/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Debug-iphoneos/libenet.a
Expand Down

0 comments on commit 2664b0a

Please sign in to comment.