Skip to content

Add targets project #115

Add targets project

Add targets project #115

name: publish-release
on:
push:
branches:
- 'master'
# - 'release/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build:
name: publish-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.100
# Authenticates packages to push to GPR
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: '%NUGET_AUTH_TOKEN%'
- name: Install dependencies
run: dotnet restore
env:
NUGET_AUTH_TOKEN: ${{ github.token }}
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Pack
run: dotnet pack --no-build --configuration Release /p:ContinuousIntegrationBuild=true
# - name: Publish web app
# run: dotnet publish Beid/DemoWebApp/DemoWebApp.csproj --configuration Release /p:PublishProfile=FolderProfile.pubxml
- name: PushNuget
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.PUBLISH_TO_NUGET_ORG }} --skip-duplicate
- name: PushGithub
run: dotnet nuget push **/*.nupkg --no-symbols --skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{ github.token }}
# - name: CreateAppOffline
# run: |
# mkdir -p tmp
# echo > tmp/app_offline.htm
# - name: UploadAppOffline
# # uses: genietim/[email protected]
# uses: tomasbkk/[email protected]
# with:
# host: ${{ secrets.FTP_SERVER }}
# user: ${{ secrets.FTP_USERNAME }}
# password: ${{ secrets.FTP_PASSWORD }}
# src: tmp/app_offline.htm
# dest: app_offline.htm
# - name: Delay
# uses: MintPlayer/github-actions/delay@v3
# with:
# milliseconds: 5000
# # - name: UploadApplication
# # uses: tomasbkk/[email protected]
# # with:
# # host: ${{ secrets.FTP_SERVER }}
# # user: ${{ secrets.FTP_USERNAME }}
# # password: ${{ secrets.FTP_PASSWORD }}
# # src: ./Beid/DemoWebApp/bin/Release/net8.0/win-x64/publish
# # dest: ./
# - name: Upload application
# uses: SamKirkland/[email protected]
# with:
# server: ${{ secrets.FTP_SERVER }}
# username: ${{ secrets.FTP_USERNAME }}
# password: ${{ secrets.FTP_PASSWORD }}
# local-dir: ./Beid/DemoWebApp/bin/Release/net8.0/win-x64/publish/
# server-dir: ./
# exclude: |
# app_offline.htm
# appsettings.*.json