Merge pull request #216 from sebastian-heinz/develop #80
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: Create Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.200 | |
- name: Build Release | |
id: build_release | |
run: | | |
DDON_VERSION_FILE=${{ github.workspace }}/ddon.version | |
DDON_VERSION=$(<"$DDON_VERSION_FILE") | |
echo "DDON_VERSION=$DDON_VERSION" >> $GITHUB_ENV | |
echo "DDON_VERSION_E=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV | |
mkdir ./release | |
for DDON_RUNTIME in win-x86 win-x64 linux-x64 osx-x64; do | |
# Server | |
dotnet publish Arrowgene.Ddon.Cli/Arrowgene.Ddon.Cli.csproj /p:Version=$DDON_VERSION /p:FromMSBuild=true --runtime $DDON_RUNTIME --configuration Release --output ./publish/$DDON_RUNTIME-$DDON_VERSION/Server | |
# ReleaseFiles | |
cp -r ./ReleaseFiles/. ./publish/$DDON_RUNTIME-$DDON_VERSION/ | |
# Pack | |
tar cjf ./release/$DDON_RUNTIME-$DDON_VERSION.tar.gz ./publish/$DDON_RUNTIME-$DDON_VERSION | |
done | |
- name: Create Release | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: release-${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }} | |
release_name: Release ${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }} | |
draft: false | |
prerelease: false | |
- name: Upload win-x86 Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release/win-x86-${{ env.DDON_VERSION }}.tar.gz | |
asset_name: win-x86-${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }}.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload win-x64 Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release/win-x64-${{ env.DDON_VERSION }}.tar.gz | |
asset_name: win-x64-${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }}.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload linux-x64 Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release/linux-x64-${{ env.DDON_VERSION }}.tar.gz | |
asset_name: linux-x64-${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }}.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload osx-x64 Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./release/osx-x64-${{ env.DDON_VERSION }}.tar.gz | |
asset_name: osx-x64-${{ env.DDON_VERSION }}-${{ env.DDON_VERSION_E }}.tar.gz | |
asset_content_type: application/gzip |