Update Shoko.Commons #406
Workflow file for this run
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
name: Build (Daily) | |
on: | |
push: | |
branches: | |
- test-tray-service-workflow | |
jobs: | |
current_info: | |
runs-on: ubuntu-latest | |
name: Current Information | |
outputs: | |
version: ${{ steps.release_info.outputs.version }} | |
date: ${{ steps.commit_date_iso8601.outputs.date }} | |
sha: ${{ github.sha }} | |
sha_short: ${{ steps.commit_info.outputs.sha }} | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@master | |
with: | |
ref: "${{ github.sha }}" | |
submodules: recursive | |
fetch-depth: 0 # This is set to download the full git history for the repo | |
- name: Get Current Version | |
id: release_info | |
uses: revam/gh-action-get-tag-and-version@v1 | |
with: | |
branch: true | |
prefix: v | |
prefixRegex: "[vV]?" | |
- name: Get Commit Date (as ISO8601) | |
id: commit_date_iso8601 | |
shell: bash | |
run: | | |
echo "date=$(git --no-pager show -s --format=%aI ${{ github.sha }})" >> "$GITHUB_OUTPUT" | |
- id: commit_info | |
name: Shorten Commit Hash | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const sha = context.sha.substring(0, 7); | |
core.setOutput("sha", sha); | |
tray-service-daily: | |
runs-on: windows-latest | |
needs: | |
- current_info | |
strategy: | |
matrix: | |
dotnet: [ '6.x' ] | |
build_type: ['Standalone', 'Framework'] | |
include: | |
- build_props: '-r win10-x64 --self-contained true -f net6.0-windows' | |
build_type: 'Standalone' | |
- build_dir: '/net6.0-windows/win10-x64' | |
build_type: 'Standalone' | |
- build_props: '' | |
build_type: 'Framework' | |
- build_dir: '/net6.0-windows' | |
build_type: 'Framework' | |
name: Build Tray Service ${{ matrix.build_type }} (Daily) | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@master | |
with: | |
ref: "${{ github.sha }}" | |
submodules: recursive | |
- name: Replace Sentry DSN and other keys | |
shell: pwsh | |
run: | | |
.\\.github\\workflows\\ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }} | |
.\\.github\\workflows\\ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }} | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- run: dotnet publish -c Release ${{ matrix.build_props }} Shoko.TrayService "/p:Version=\`"${{ needs.current_info.outputs.version }}\`",InformationalVersion=\`"channel=dev,commit=${{ needs.current_info.outputs.sha }},date=${{ needs.current_info.outputs.date }}\`"" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Shoko.TrayService_${{ matrix.build_type }}_win10-x64.zip | |
path: Shoko.Server/bin/Release${{ matrix.build_dir }}/publish/ | |
- name: Upload to shokoanime.com | |
if: ${{ matrix.build_type == 'Standalone' }} | |
shell: pwsh | |
env: | |
FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | |
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | |
FTP_SERVER: ${{ secrets.FTP_SERVER }} | |
run : Compress-Archive .\\Shoko.Server\\bin\\Release\\net6.0-windows\\win10-x64\\publish .\\ShokoServer.zip && .\\.github\\workflows\\UploadArchive.ps1 |