Skip to content

use auto updated assets from server #381

use auto updated assets from server

use auto updated assets from server #381

Workflow file for this run

name: Publish dev Build
on:
push:
branches:
- master
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
publish:
strategy:
matrix:
rid: [ win-x64, linux-x64, linux-arm64, linux-arm, osx-x64, osx-arm64 ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# - name: Restore dependencies
# run: dotnet restore
- name: Set Version in csproj
# replace <Version>0.0.0</Version> with <Version>tag</Version>, where tag is the tag name, tag should trim start "v"
run: sed -i "s/<Version>.*<\/Version>/<Version>$(echo ${{github.ref_name}} | sed 's@v@@g')<\/Version>/g" ./MementoMori.WebUI/MementoMori.WebUI.csproj
if: startsWith(github.ref, 'refs/tags/')
- name: Publish ${{matrix.rid}}
run: dotnet workload restore && dotnet publish ./MementoMori.WebUI/MementoMori.WebUI.csproj -f net8.0 -c Release -r ${{matrix.rid}} -o publish-${{matrix.rid}} --sc -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true -p:EnableCompressionInSingleFile=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
if: github.ref == 'refs/heads/master'
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@v4
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
moonheartmoon/mementomori-webui
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Version in csproj
# replace <Version>0.0.0</Version> with <Version>tag</Version>, where tag is the tag name, tag should trim start "v"
run: sed -i "s/<Version>.*<\/Version>/<Version>$(echo ${{github.ref_name}} | sed 's@v@@g')<\/Version>/g" ./MementoMori.WebUI/MementoMori.WebUI.csproj
if: startsWith(github.ref, 'refs/tags/')
- name: Build and push
uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
context: .
platforms: linux/amd64,linux/arm64
file: ./MementoMori.WebUI/Dockerfile
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push
uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/heads/master')
with:
push: true
tags: moonheartmoon/mementomori-webui:dev
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./MementoMori.WebUI/Dockerfile
publish-maui-android:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install MAUI workload
run: dotnet workload install maui
- name: Write keystore
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.KEYSTORE_BASE64_ENCODED }}")
[IO.File]::WriteAllBytes("MementoMori.Maui/mementomori-helper.keystore", $pfx_cert_byte)
- name: Build Android
run: dotnet publish .\MementoMori.Maui\MementoMori.Maui.csproj -c Release -f net8.0-android -p:AndroidSigningStorePass=env:KEYSTORE_PASSWORD -p:AndroidSigningKeyPass=env:KEYSTORE_PASSWORD -p:ApplicationDisplayVersion=$((echo ${{github.ref_name}}) -replace 'v') -p:ApplicationVersion=${{github.run_number}} -o publish-android
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Create Dev Release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/master'
with:
files: |
./publish-android/io.github.moonheart.mementomorihelper-Signed.apk
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-android/io.github.moonheart.mementomorihelper-Signed.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}