Rename workflow files #1
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
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/workflows/Deploy_Desktop.yml' | |
- '.github/workflows/shared/**' | |
- 'src/DesktopClient/**' | |
- '*..md' | |
- 'Build/**' | |
- '.chocolatey/**' | |
pull_request: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/workflows/Deploy_Desktop.yml' | |
- '.github/workflows/shared/**' | |
- 'src/DesktopClient/**' | |
- '*..md' | |
- 'Build/**' | |
- '.chocolatey/**' | |
jobs: | |
Setup_Web: | |
name: Setup Web | |
runs-on: windows-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
BuildConfiguration: Release | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
GitHubReleaseUrl: https://github.com/isaacrlevin/presencelight/releases/download/Web- | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use .NET Core SDK 8.0.x | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Nerdbank.GitVersioning | |
uses: dotnet/nbgv@v0.4.1 | |
with: | |
setCommonVars: true | |
- run: echo "BuildNumber - ${{ env.GitBuildVersionSimple }}" | |
- name: Update appsettings.json | |
run: | | |
./Build/scripts/update-web-json.ps1 -Version "${{ env.GitBuildVersionSimple }}" -ApplicationId "${{ secrets.ApplicationId }}" ` | |
-ClientSecret "${{ secrets.ClientSecret }}" -InstrumentationKey "${{ secrets.InstrumentationKey }}" ` | |
-LIFXClientId "${{ secrets.LIFXClientId }}" -LIFXClientSecret "${{ secrets.LIFXClientSecret }}" ` | |
-RemoteHueClientId "${{ secrets.RemoteHueClientId }}" -RemoteHueClientSecret "${{ secrets.RemoteHueClientSecret }}" ` | |
-RemoteHueClientAppName "${{ secrets.RemoteHueClientAppName }}" | |
shell: powershell | |
if: ${{ success() && github.event_name != 'pull_request' }} | |
- name: Create Version File to Artifact | |
run : | | |
New-Item -Path ${{ github.workspace }}\Build -Name "version.txt" -ItemType "file" -Value "${{ env.GitBuildVersionSimple }}" | |
shell: powershell | |
- name: Publish Arifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ github.workspace }}\src | |
name: PreBuild | |
- name: Publish signing scripts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: Build | |
name: SigningScripts | |
if: ${{ success() }} | |
Build_Web: | |
name: Build Web | |
needs: Setup_Web | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- ChannelName: Windows_x64_x86 | |
RID: win-x64 | |
- ChannelName: Windows_ARM | |
RID: win-arm64 | |
- ChannelName: macOS | |
RID: osx-x64 | |
- ChannelName: Linux_ARM | |
RID: linux-arm | |
- ChannelName: Linux_ARM64 | |
RID: linux-x64 | |
- ChannelName: Linux_Musl_x64 | |
RID: linux-musl-x64 | |
- ChannelName: Linux_Musl_ARM_x64 | |
RID: linux-musl-arm64 | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
BuildConfiguration: Release | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
GitHubReleaseUrl: https://github.com/isaacrlevin/presencelight/releases/download/Web- | |
steps: | |
- name: Use .NET Core SDK 8.0.x | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Download PreBuild | |
uses: actions/download-artifact@v3 | |
with: | |
name: PreBuild | |
path: ${{ github.workspace }}/src | |
- uses: actions/download-artifact@v3 | |
name: Download Signing Scripts Artifacts | |
with: | |
name: SigningScripts | |
path: "${{ github.workspace }}/SigningScripts" | |
- name: Get Version from File | |
run: | | |
version=$(<"${{ github.workspace }}/SigningScripts/version.txt") | |
echo "GitBuildVersionSimple=$version" >> $GITHUB_ENV | |
- name: Create Directory for Channel | |
run: mkdir ${{ github.workspace }}/${{ matrix.ChannelName }} | |
- run: dotnet publish './src/PresenceLight.Web/PresenceLight.Web.csproj' -r ${{ matrix.RID }} -c ${{ env.BuildConfiguration }} /p:PublishSingleFile=true -o ${{ github.workspace }}/PresenceLight.${{ env.GitBuildVersionSimple }}_${{ matrix.ChannelName }} /p:Version=${{ env.GitBuildVersionSimple }} | |
name: dotnet publish ${{ matrix.RID }} | |
if: ${{ success() }} | |
- name: Zip PresenceLight Web Files | |
run: | | |
Compress-Archive -Path '${{ github.workspace }}/PresenceLight.${{ env.GitBuildVersionSimple }}_${{ matrix.ChannelName }}' ` | |
-DestinationPath ${{ github.workspace }}/${{ matrix.ChannelName }}/PresenceLight.${{ matrix.ChannelName }}.${{ env.GitBuildVersionSimple }}.zip | |
shell: pwsh | |
- name: Publish Arifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ github.workspace }}/${{ matrix.ChannelName }} | |
name: ${{ matrix.ChannelName }} | |
Code_Signing: | |
needs: Build_Web | |
strategy: | |
matrix: | |
target: [ Windows_x64_x86, Windows_ARM, macOS, Linux_ARM, Linux_ARM64, Linux_Musl_x64, Linux_Musl_ARM_x64 ] | |
uses: isaacrlevin/presencelight/.github/workflows/Sign.yml@main | |
with: | |
target: ${{ matrix.target }} | |
secrets: inherit | |
Deploy_Azure_Blob: | |
needs: Code_Signing | |
name: Deploy Worker to Blob Storage | |
if: ${{ github.event_name != 'pull_request' }} | |
strategy: | |
matrix: | |
target: [ Windows_x64_x86, Windows_ARM, macOS, Linux_ARM, Linux_ARM64, Linux_Musl_x64, Linux_Musl_ARM_x64 ] | |
uses: isaacrlevin/presencelight/.github/workflows/Azure_Blob_Deploy.yml@main | |
with: | |
target: ${{ matrix.target }} | |
secrets: inherit | |
Deploy_Containers: | |
needs: Build_Web | |
if: ${{ github.event_name != 'pull_request' }} | |
environment: | |
name: Deploy_Containers | |
url: ${{ steps.deploy_staging.outputs.webapp-url }} | |
name: Deploy Web Containers (DockerHub / GitHub Packages) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download PreBuild | |
uses: actions/download-artifact@v3 | |
with: | |
name: PreBuild | |
path: ${{ github.workspace }}/src | |
- uses: actions/download-artifact@v3 | |
name: Download Signing Scripts Artifacts | |
with: | |
name: SigningScripts | |
path: "${{ github.workspace }}/SigningScripts" | |
- name: Get Version from File | |
run: | | |
version=$(<"${{ github.workspace }}/SigningScripts/version.txt") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Update Docker Files | |
run: | | |
$dockerFileLatest = Get-Content -path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile" -Raw | |
$dockerFileLatest = $dockerFileLatest -replace '{VERSION}', "${{ env.VERSION }} " | |
$dockerFileLatest | Set-Content -Path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile" | |
$dockerFile32 = Get-Content -path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm32" -Raw | |
$dockerFile32 = $dockerFile32 -replace '{VERSION}', "${{ env.VERSION }} " | |
$dockerFile32 | Set-Content -Path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm32" | |
$dockerFile64 = Get-Content -path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm64" -Raw | |
$dockerFile64 = $dockerFile64 -replace '{VERSION}', "${{ env.VERSION }} " | |
$dockerFile64 | Set-Content -Path "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm64" | |
shell: pwsh | |
if: ${{ success() && github.event_name != 'pull_request' }} | |
- name: Push latest to GitHub | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: isaacrlevin | |
REGISTRY: "ghcr.io" | |
PASSWORD: ${{ secrets.GH_PERSONAL_TOKEN }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile" | |
IMAGE_NAME: "isaacrlevin/presencelight" | |
TAG_NAME: "${{ env.VERSION }}" | |
LATEST: "true" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM to GitHub | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: isaacrlevin | |
REGISTRY: "ghcr.io" | |
PASSWORD: ${{ secrets.GH_PERSONAL_TOKEN }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm32" | |
IMAGE_NAME: "isaacrlevin/presencelight" | |
TAG_NAME: "debian-arm32" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM64 to GitHub | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: isaacrlevin | |
REGISTRY: "ghcr.io" | |
PASSWORD: ${{ secrets.GH_PERSONAL_TOKEN }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm64" | |
IMAGE_NAME: "isaacrlevin/presencelight" | |
TAG_NAME: "debian-arm64" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM to DockerHub (Versioned) | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm32" | |
IMAGE_NAME: "isaaclevin/presencelight" | |
TAG_NAME: "${{ env.VERSION }}-debian-arm32" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM to DockerHub (Latest) | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm32" | |
IMAGE_NAME: "isaaclevin/presencelight" | |
TAG_NAME: "debian-arm32" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM64 to DockerHub (Versioned) | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm64" | |
IMAGE_NAME: "isaaclevin/presencelight" | |
TAG_NAME: "${{ env.VERSION }}-debian-arm64" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push ARM64 to DockerHub (Latest) | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile.debian-arm64" | |
IMAGE_NAME: "isaaclevin/presencelight" | |
TAG_NAME: "debian-arm64" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
- name: Push latest to DockerHub | |
uses: opspresso/action-docker@master | |
with: | |
args: --docker | |
env: | |
USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKERFILE: "${{ github.workspace }}/src/PresenceLight.Web/Dockerfile" | |
IMAGE_NAME: "isaaclevin/presencelight" | |
TAG_NAME: "${{ env.VERSION }}" | |
LATEST: "true" | |
BUILD_PATH: "${{ github.workspace }}/src/" | |
Deploy_GitHub_Release: | |
needs: Deploy_Azure_Blob | |
if: ${{ github.event_name != 'pull_request' }} | |
environment: | |
name: Deploy_GitHub_Release | |
url: ${{ steps.deploy_staging.outputs.webapp-url }} | |
name: Deploy Web GitHub Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate changelog | |
id: changelog | |
uses: jaywcjlove/changelog-generator@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
filter: '' | |
env: | |
commitMode: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download Windows_x64_x86 Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Windows_x64_x86 | |
path: ${{ github.workspace }}/Sign/Windows_x64_x86 | |
- name: Download Windows_ARM Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Windows_ARM | |
path: ${{ github.workspace }}/Sign/Windows_ARM | |
- name: Download macOS Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: macOS | |
path: ${{ github.workspace }}/Sign/macOS | |
- name: Download Linux_ARM Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Linux_ARM | |
path: ${{ github.workspace }}/Sign/Linux_ARM | |
- name: Download Linux_ARM64 Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Linux_ARM64 | |
path: ${{ github.workspace }}/Sign/Linux_ARM64 | |
- name: Download Linux_Musl_x64 Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Linux_Musl_x64 | |
path: ${{ github.workspace }}/Sign/Linux_Musl_x64 | |
- name: Download Linux_Musl_ARM_x64 Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Linux_Musl_ARM_x64 | |
path: ${{ github.workspace }}/Sign/Linux_Musl_ARM_x64 | |
- uses: actions/download-artifact@v3 | |
name: Download Signing Scripts Artifacts | |
with: | |
name: SigningScripts | |
path: "${{ github.workspace }}/SigningScripts" | |
- name: Get Version from File | |
run: | | |
version=$(<"${{ github.workspace }}/SigningScripts/version.txt") | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
tag_name: "Web-v${{ env.VERSION }}" | |
body: ${{ steps.changelog.outputs.changelog }} | |
fail_on_unmatched_files: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
${{ github.workspace }}/Sign/**/*.zip | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 |