Skip to content

Update main.yml

Update main.yml #3

Workflow file for this run

name: Build and Publish
on:
push:
branches:
- main
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Clone Drizzle
run: git clone --branch embedded https://github.com/HenryMarkle/Drizzle
- name: Moving into subdirectory
run: cd ./Drizzle
- name: Run Drizzle Transpiler
run: dotnet run --project Drizzle.Transpiler
- name: Build Drizzle
run: dotnet build --configuration Release
- name: Moving out of subdirectory
run: cd ..
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Publish
run: dotnet publish --configuration Release --output ./output
- name: Copy assets folder to output directory
run: cp -r ./assets ./output/assets
- name: Archive output
uses: actions/upload-artifact@v2
with:
name: linux-binaries
path: ./output
- name: Create GitHub Release
if: github.ref == 'refs/heads/main'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
release_name: Release v${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output
asset_name: linux-output.zip
asset_content_type: application/zip
build-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Clone Drizzle
run: git clone --branch embedded https://github.com/HenryMarkle/Drizzle
- name: Moving into subdirectory
run: cd ./Drizzle
- name: Run Drizzle Transpiler
run: dotnet run --project Drizzle.Transpiler
- name: Build Drizzle
run: dotnet build --configuration Release
- name: Moving out of subdirectory
run: cd ..
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Publish
run: dotnet publish --configuration Release --output ./output
- name: Copy assets folder to output directory
run: Copy-Item -Recurse -Path ./assets -Destination ./output/assets
- name: Archive output
uses: actions/upload-artifact@v2
with:
name: windows-binaries
path: ./output
- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.build-linux.outputs.create_release.outputs.upload_url }}
asset_path: ./output
asset_name: windows-output.zip
asset_content_type: application/zip