Skip to content

ci: use shared GitHub Action #144

ci: use shared GitHub Action

ci: use shared GitHub Action #144

Workflow file for this run

name: Combined CI / Release
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- '**'
env:
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }}
jobs:
ci_cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: CI/CD
id: mu88-ci-cd
uses: mu88/github-actions/ci-cd@1.1
with:
github-ref-name: ${{ github.ref }}
sonar-key: 'mu88_Project28'
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-additional-params: '/d:sonar.cs.opencover.reportsPaths=src/Tests/coverage.opencover.xml /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml'
docker-publish-mode: regular_and_chiseled_extra
docker-publish-project: 'src/WebApp/WebApp.csproj'
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build single-file EXE
run: dotnet publish src/WebApp/WebApp.csproj -r win-x64 -p:PublishSingleFile=true --self-contained true
- name: Create ZIP for release
uses: thedoctor0/zip-release@master
if: ${{ env.IS_RELEASE == 'true' }}
with:
type: 'zip'
filename: ThisIsYourLife.${{ steps.mu88-ci-cd.outputs.release-version }}.zip
directory: 'src/WebApp/bin/Release/net9.0/win-x64/publish'
- name: Create CHANGELOG
id: changelog
uses: Requarks/changelog-action@v1
if: ${{ env.IS_RELEASE == 'true' }}
with:
token: ${{ github.token }}
tag: ${{ steps.mu88-ci-cd.outputs.release-version }}
excludeTypes: build,docs,other,style,chore(deps)
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: ${{ env.IS_RELEASE == 'true' }}
with:
files: src/WebApp/bin/Release/net9.0/win-x64/publish/ThisIsYourLife*.zip
tag_name: ${{ steps.mu88-ci-cd.outputs.release-version }}
body: ${{ steps.changelog.outputs.changes }}