-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from dolkensp/feature/github-actions
Implement GitHub Pipeline for CI builds
- Loading branch information
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
env: | ||
UNP4K_VERSION: 3.13.${{ github.run_number }} | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Nuget | ||
uses: nuget/setup-nuget@v1 | ||
with: | ||
nuget-version: '5.x' | ||
|
||
- name: Setup MSBuild | ||
id: setup_msbuild | ||
uses: microsoft/[email protected] | ||
|
||
- name: Restore dependencies | ||
run: nuget restore | ||
|
||
- name: Build | ||
run: msbuild unp4k.sln /m /verbosity:minimal /p:Configuration=Release | ||
|
||
- name: Package | ||
shell: cmd | ||
run: | | ||
cd src | ||
copy unp4k\bin\Release\net47\win-x64\unp4k.exe unp4k.gui\bin\Release\unp4k.exe | ||
erase *.pdb /s | ||
erase *.exe.config /s | ||
erase *.xml /s | ||
erase System.Net.Http.dll /s | ||
erase System.Runtime.dll /s | ||
erase System.IO.dll /s | ||
erase System.Security.*.dll /s | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: unp4k-suite-v${{ env.UNP4K_VERSION }} | ||
path: src/unp4k.gui/bin/Release | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: unforge-v${{ env.UNP4K_VERSION }} | ||
path: src/unforge/bin/Release/net47/win-x64 | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: unp4k-v${{ env.UNP4K_VERSION }} | ||
path: src/unp4k/bin/Release/net47/win-x64 | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'push') | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Load README | ||
run: | | ||
echo "README<<EOF" >> $GITHUB_ENV | ||
cat README.md >> $GITHUB_ENV | ||
echo 'EOF' >> $GITHUB_ENV | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ env.UNP4K_VERSION }} | ||
release_name: unp4k Tools for Star Citizen | ||
body: ${{ env.README }} | ||
draft: false | ||
prerelease: false | ||
|
||
publish: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'push') | ||
strategy: | ||
max-parallel: 3 | ||
matrix: | ||
artifact: [ unp4k, unp4k-suite, unforge ] | ||
steps: | ||
- name: Load | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }} | ||
path: ${{ matrix.artifact }} | ||
|
||
- name: Compress | ||
run: (cd ${{ matrix.artifact }} && zip -r ../${{ matrix.artifact }}.zip .) | ||
|
||
- name: Upload | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ${{ matrix.artifact }}.zip | ||
asset_name: ${{ matrix.artifact }}-v${{ env.UNP4K_VERSION }}.zip | ||
asset_content_type: application/zip |