Skip to content

test: Disable OTEL in ci #484

test: Disable OTEL in ci

test: Disable OTEL in ci #484

Workflow file for this run

name: Release
on:
push:
branches: [ master ]
tags: [ v*.*.* ]
paths-ignore:
- '**.md'
- 'docs/**'
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build-windows:
name: Build for Windows
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- run: $env:BUILD_TAG = "-nightly"
if: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- run: dotnet restore --locked-mode /p:Configuration="Release"
- name: Publish desktop application
run: >
deployment/publish.ps1
"Gnomeshade.Desktop"
"win-x64"
"${{ github.run_number }}"
$env:BUILD_TAG
- name: Build installer
id: publish
run: deployment/build.ps1 "Gnomeshade.Desktop.Installer"
- uses: actions/[email protected]
with:
name: ${{ steps.publish.outputs.artifact-name }}
path: ${{ steps.publish.outputs.artifact }}
build-linux:
strategy:
matrix:
project:
- Gnomeshade.Desktop
- Gnomeshade.WebApi
name: Build for Linux
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'source/Gnomeshade.WebApi/Node/package-lock.json'
- run: echo "BUILD_TAG=-nightly"
if: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: Publish project
id: publish
run: >
deployment/publish.sh
"${{ matrix.project }}"
"linux-x64"
"${{ github.run_number }}"
"-nightly"
- uses: actions/[email protected]
with:
name: ${{ steps.publish.outputs.artifact-name }}
path: ${{ steps.publish.outputs.artifact }}
build-deb:
name: Build debian package
needs: build-linux
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
id: download
with:
name: Gnomeshade.WebApi_linux-x64.zip
- name: Build debian package
run: >
deployment/debian.sh
"${{ steps.download.outputs.download-path }}/Gnomeshade.WebApi_linux-x64.zip"
"${{ github.run_number }}"
- uses: actions/[email protected]
with:
name: Gnomeshade.WebApi_linux-x64.deb
path: "**/*.deb"
nuget:
name: Publish NuGet packages
runs-on: ubuntu-latest
concurrency: release-nuget
timeout-minutes: 5
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- name: Cache NuGet packages
uses: actions/[email protected]
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: Pack package
id: pack
run: deployment/pack-nightly.sh "Gnomeshade.WebApi.Client" "${{ github.run_number }}" "${{ github.ref }}"
- name: Push package to GitHub
run: >
dotnet nuget push "${{ steps.pack.outputs.artifact }}"
--api-key ${{ secrets.GITHUB_TOKEN }}
--source https://nuget.pkg.github.com/VMelnalksnis/index.json
- name: Push package to NuGet
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: >
dotnet nuget push "${{ steps.pack.outputs.artifact }}"
--api-key ${{ secrets.NUGET_KEY }}
--source https://api.nuget.org/v3/index.json
docker-release:
name: Build docker image
runs-on: ubuntu-latest
concurrency: release-docker-release
timeout-minutes: 10
steps:
- uses: actions/[email protected]
- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: ./deployment/docker_push.sh "${{ github.run_number }}" "nightly"
if: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
- run: ./deployment/docker_push.sh "${{ github.run_number }}"
if: ${{ (startsWith(github.ref, 'refs/tags/')) }}
deploy-demo:
name: Deploy demo app
needs: build-linux
runs-on: ubuntu-latest
concurrency: deploy-demo
timeout-minutes: 10
env:
AZURE_APP_NAME: gnomeshade-demo
AZURE_APP_DOMAIN: 'https://gnomeshade-demo.azurewebsites.net/'
steps:
- uses: actions/[email protected]
id: download
with:
name: Gnomeshade.WebApi_linux-x64.zip
- run: unzip Gnomeshade.WebApi_linux-x64.zip
- run: rm Gnomeshade.WebApi_linux-x64.zip
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_APP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '.'
- uses: azure/appservice-settings@v1
with:
app-name: ${{ env.AZURE_APP_NAME }}
app-settings-json: |
[
{
"name": "Admin__Password",
"value": "${{ secrets.DEMO_ADMIN_PASSWORD }}",
"slotSetting": false
},
{
"name": "ConnectionStrings__Gnomeshade",
"value": "Data Source=/tmp/gnomeshade.db",
"slotSetting": false
},
{
"name": "Database__Provider",
"value": "Sqlite",
"slotSetting": false
},
{
"name": "Jwt__Secret",
"value": "${{ secrets.DEMO_JWT_SECRET }}",
"slotSetting": false
},
{
"name": "Jwt__ValidAudience",
"value": "${{ env.AZURE_APP_DOMAIN }}",
"slotSetting": false
},
{
"name": "Jwt__ValidIssuer",
"value": "${{ env.AZURE_APP_DOMAIN }}",
"slotSetting": false
},
{
"name": "OAuth__GitHub__ClientId",
"value": "${{ secrets.DEMO_GITHUB_ID }}",
"slotSetting": false
},
{
"name": "OAuth__GitHub__ClientSecret",
"value": "${{ secrets.DEMO_GITHUB_SECRET }}",
"slotSetting": false
}
]
- run: wget --retry-connrefused --retry-on-http-error=502 --waitretry=5 --read-timeout=120 --timeout=120 -t 5 ${{ env.AZURE_APP_DOMAIN }}
create-release:
name: Create release
needs:
- build-windows
- build-linux
- build-deb
runs-on: ubuntu-latest
concurrency: create-release
timeout-minutes: 5
steps:
- uses: actions/[email protected]
id: download
with:
path: artifacts
- name: Upload artifact to nightly release
if: ${{ !(startsWith(github.ref, 'refs/tags/')) }}
uses: pyTooling/Actions/releaser/composite@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
rm: true
files: |
${{ steps.download.outputs.download-path }}/**/*.zip
${{ steps.download.outputs.download-path }}/**/*.deb
${{ steps.download.outputs.download-path }}/**/*.msi
- name: Create release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/[email protected]
with:
draft: true
prerelease: false
tag_name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
${{ steps.download.outputs.download-path }}/**/*.zip
${{ steps.download.outputs.download-path }}/**/*.deb
${{ steps.download.outputs.download-path }}/**/*.msi