Skip to content

testing workflow

testing workflow #41

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "unstable" ]
pull_request:
branches: [ "unstable" ]
jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest ]
dotnet-version: [ '8.0.x' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Display dotnet version
run: dotnet --version
- name: "List all files"
run: ls -R
release:
strategy:
matrix:
os: [ ubuntu-latest ]
dotnet-version: [ '8.0.x' ]
version: [ '0.2.6' ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Publish
run: |
dotnet publish bookmark-dlp.sln --configuration Release --runtime win-x64 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime win-x86 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime win-arm64 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime linux-x64 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime linux-arm64 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime osx-x64 --self-contained
dotnet publish bookmark-dlp.sln --configuration Release --runtime osx-arm64 --self-contained
- name: "List all files"
run: |
echo $PWD
ls -R
- name: "Rename based on architecture"
run: |
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-x64/publish/bookmark-dlp.exe" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-x64/publish/bookmark-dlp-win-x64-${{ matrix.dotnet-version }}.exe"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-x86/publish/bookmark-dlp.exe" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-x86/publish/bookmark-dlp-win-x86-${{ matrix.dotnet-version }}.exe"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/linux-arm64/publish/bookmark-dlp" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/linux-arm64/publish/bookmark-dlp-linux-arm64-${{ matrix.dotnet-version }}"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/linux-x64/publish/bookmark-dlp" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/linux-x64/publish/bookmark-dlp-linux-x64-${{ matrix.dotnet-version }}"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/osx-x64/publish/bookmark-dlp" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/osx-x64/publish/bookmark-dlp-osx-x64-${{ matrix.dotnet-version }}"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/osx-arm64/publish/bookmark-dlp" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/osx-arm64/publish/bookmark-dlp-osx-arm64"
mv "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-arm64/publish/bookmark-dlp.exe" "/home/runner/work/bookmark-dlp/bookmark-dlp/bin/Release/net8.0/win-arm64/publish/bookmark-dlp-win-arm64-${{ matrix.dotnet-version }}.exe"
- name: "Delete old release"
env:
GH_TOKEN: ${{ github.token }}
run: |
#gh release delete alpha
echo delete
- name: "Create new prerelease"
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ matrix.version }}" --target unstable --prerelease --title "Development build ${{ matrix.version }}" --generate-notes
- name: Upload
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/win-x64/publish/bookmark-dlp-win-x64-${{ matrix.dotnet-version }}.exe" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/win-x86/publish/bookmark-dlp-win-x86-${{ matrix.dotnet-version }}.exe" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/linux-arm64/publish/bookmark-dlp-linux-arm64-${{ matrix.dotnet-version }}" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/linux-x64/publish/bookmark-dlp-linux-x64-${{ matrix.dotnet-version }}" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/osx-x64/publish/bookmark-dlp-osx-x64-${{ matrix.dotnet-version }}" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/osx-arm64/publish/bookmark-dlp-osx-arm64" --clobber
gh release upload "${{ matrix.version }}" "./bin/Release/net8.0/win-arm64/publish/bookmark-dlp-win-arm64-${{ matrix.dotnet-version }}.exe" --clobber
#comments https://github.com/seerge/g-helper/blob/main/.github/workflows/release.yml
# Optional global.json location, if your global.json isn't located in the root of the repo.
#global-json-file:
# Optional package source for which to set up authentication. Will consult any existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the NUGET_AUTH_TOKEN environment variable as a ClearTextPassword
#source-url:
# Optional NuGet.config location, if your NuGet.config isn't located in the root of the repo.
#config-file: # optional