From 3ffa7166464c9db98830c7ddad49d182e91c6be9 Mon Sep 17 00:00:00 2001 From: Xiao Ling Date: Tue, 14 Nov 2023 09:42:09 +0800 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..25c661d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,50 @@ +name: blazorwasm + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '7.0.x' + include-prerelease: true + + - name: Change directory + run: cd example + + - name: Publish .NET Core Project + run: dotnet publish example.csproj -c Release -o release --nologo + + - name: Change base-tag in index.html from / to Razor-Barcode-Library + run: sed -i 's///g' release/wwwroot/index.html + + - name: copy index.html to 404.html + run: cp release/wwwroot/index.html release/wwwroot/404.html + + - name: Add .nojekyll file + run: touch release/wwwroot/.nojekyll + + - name: Commit wwwroot to GitHub Pages + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: release/wwwroot From c3fdd4bfbc37ec6405080b1363d6d16ade269813 Mon Sep 17 00:00:00 2001 From: Xiao Ling Date: Tue, 14 Nov 2023 09:50:42 +0800 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25c661d..1b9df5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,25 +26,26 @@ jobs: with: dotnet-version: '7.0.x' include-prerelease: true - - - name: Change directory - run: cd example - name: Publish .NET Core Project run: dotnet publish example.csproj -c Release -o release --nologo + working-directory: ./example - name: Change base-tag in index.html from / to Razor-Barcode-Library run: sed -i 's///g' release/wwwroot/index.html + working-directory: ./example - name: copy index.html to 404.html run: cp release/wwwroot/index.html release/wwwroot/404.html + working-directory: ./example - name: Add .nojekyll file run: touch release/wwwroot/.nojekyll + working-directory: ./example - name: Commit wwwroot to GitHub Pages uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages - FOLDER: release/wwwroot + FOLDER: example/release/wwwroot