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:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-12-13 23:27:06 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-12-13 23:27:13 +0300
commite59563aff20d65f1c568856e9e0b7e07ffa0287c (patch)
treec14154aec928f05209f698495ccd45a5beaebb1e
parentaa8a5681e82e3262a629492bdd0803444d8ec9c1 (diff)
GitHub Pages
-rw-r--r--.github/workflows/build-test.yml59
-rw-r--r--.github/workflows/tests.yml30
-rw-r--r--NesTiler/ColorFinder.cs2
-rw-r--r--README.md5
4 files changed, 63 insertions, 33 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
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
deleted file mode 100644
index 9bc41dd..0000000
--- a/.github/workflows/tests.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: Tests
-
-on:
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
- workflow_dispatch:
-
-jobs:
- tests:
- 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
diff --git a/NesTiler/ColorFinder.cs b/NesTiler/ColorFinder.cs
index 0a615cb..9705dc3 100644
--- a/NesTiler/ColorFinder.cs
+++ b/NesTiler/ColorFinder.cs
@@ -48,7 +48,7 @@ namespace com.clusterrr.Famicom.NesTiler
{
try
{
- var index = kv.Key.ToLower().StartsWith("0x") ? Convert.ToByte(kv.Key.Substring(2), 16) : byte.Parse(kv.Key);
+ var index = kv.Key.ToLower().StartsWith("0x") ? Convert.ToByte(kv.Key[2..], 16) : byte.Parse(kv.Key);
if (FORBIDDEN_COLORS.Contains(index))
Trace.WriteLine($"WARNING! color #{kv.Key} is forbidden color, it will be ignored.");
if (index > 0x3F) throw new ArgumentException($"{kv.Key} - invalid color index.", filename);
diff --git a/README.md b/README.md
index 68b9000..6641930 100644
--- a/README.md
+++ b/README.md
@@ -229,6 +229,11 @@ Examples:
* nestiler -q
* nestiler -quiet ...
+## Download
+You can always download latest version at [https://github.com/ClusterM/NesTiler/releases](https://github.com/ClusterM/NesTiler/releases).
+
+Also, you can download automatic nightly builds: [http://clusterm.github.io/NesTiler/](http://clusterm.github.io/NesTiler/).
+
## Donate
https://www.donationalerts.com/r/clustermeerkat