Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NesTiler.git/NesTiler.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-test.yml')
-rw-r--r--.github/workflows/build-test.yml59
1 files changed, 57 insertions, 2 deletions
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml
index 6172e0d..091aed9 100644
--- a/.github/workflows/build-test.yml
+++ b/.github/workflows/build-test.yml
@@ -1,4 +1,4 @@
-name: Build test
+name: Build, test, upload
on:
push:
@@ -7,6 +7,12 @@ on:
branches: [ master ]
workflow_dispatch:
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
jobs:
build:
strategy:
@@ -29,6 +35,7 @@ jobs:
OUTPUT_DIR: output
CONFIGURATION: Release
OUTPUT_SUBDIR: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.sc }}
+ OUTPUT_FILE: nestiler-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.sc == 'self-contained' && '-self-contained' || '' }}.${{ matrix.os == 'win' && 'zip' || 'tar.gz' }}
steps:
- name: Fix line endings
run: git config --global core.autocrlf false
@@ -42,8 +49,56 @@ jobs:
env:
SC_OPS: ${{ matrix.sc == 'self-contained' && '--self-contained true' || '--no-self-contained' }}
run: dotnet publish ${{ env.PROJECT_PATH }} -c ${{ env.CONFIGURATION }} -r ${{ matrix.os }}-${{ matrix.arch }} -p:PublishSingleFile=true ${{ env.SC_OPS }} -o ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT_SUBDIR }}/${{ env.APP_NAME }} -p:IncludeAllContentForSelfExtract=true
+ - name: Archive
+ working-directory: ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT_SUBDIR }}
+ env:
+ CMD: ${{ matrix.os == 'win' && 'zip -r9' || 'tar -czvf' }}
+ run: |
+ ${{ env.CMD }} ../../${{ env.OUTPUT_FILE }} ${{ env.APP_NAME }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.OUTPUT_SUBDIR }}
- path: ${{ env.OUTPUT_DIR }}/${{ env.OUTPUT_SUBDIR }}
+ path: ${{ env.OUTPUT_FILE }}
+
+ tests:
+ needs: build
+ strategy:
+ matrix:
+ host: [windows-latest, ubuntu-latest, macos-latest]
+ runs-on: ${{ matrix.host }}
+ env:
+ TESTS_PATH: ./Tests
+ CONFIGURATION: Release
+ TESTS_CONFIGURATION: Debug
+ steps:
+ - name: Fix line endings
+ run: git config --global core.autocrlf false
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v2
+ with:
+ dotnet-version: 6.0.x
+ - name: Tests
+ run: dotnet test ${{ env.TESTS_PATH }} -c ${{ env.TESTS_CONFIGURATION }} -p:PublishSingleFile=true
+
+ upload-to-pages:
+ needs: tests
+ runs-on: ubuntu-latest
+ steps:
+ - name: Download artifacts
+ uses: actions/download-artifact@v3
+ - name: Move files to the root
+ run: find -mindepth 2 -exec mv {} . \;
+ - name: Remove empty directories
+ run: find -mindepth 1 -type d -delete
+ - name: Generate index.html
+ run: "(echo \"<html><head><title>NesTiler</title></head><body>Updated: `date`<br/><br/>\" ; for file in nestiler-* ; do echo \"<a href='$file'>$file</a><br/>\" ; done ; echo \"</body></html>\") > index.html"
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v1
+ with:
+ path: '.'
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v1