add release version #49
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: Publish dev Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- * | ||
workflow_dispatch: | ||
jobs: | ||
publish: | ||
strategy: | ||
matrix: | ||
rid: [win-x64, linux-x64, linux-arm64] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build ./MementoMori.WebUI/MementoMori.WebUI.csproj -c Release --no-restore | ||
- name: Publish ${{matrix.rid}} | ||
run: dotnet publish ./MementoMori.WebUI/MementoMori.WebUI.csproj -c Release -r ${{matrix.rid}} -p:RunAOTCompilation=true -o publish-${{matrix.rid}} --sc -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:EnableCompressionInSingleFile=true -p:PublishReadyToRun=true | ||
- name: Archive Release ${{matrix.rid}} | ||
uses: thedoctor0/zip-release@0.7.1 | ||
with: | ||
type: 'zip' | ||
filename: 'publish-${{matrix.rid}}.zip' | ||
path: './publish-${{matrix.rid}}/' | ||
- name: Create Dev Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./publish-${{matrix.rid}}.zip | ||
tag_name: dev | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
./publish-${{matrix.rid}}.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
publish-docker: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
tags: moonheartmoon/mementomori-webui:v1 | ||
context: . | ||
file: ./MementoMori.WebUI/Dockerfile |