From f203167f2663d7771d9ce304adeba861544123e1 Mon Sep 17 00:00:00 2001 From: Isabelle Seah Date: Fri, 28 Apr 2023 14:45:24 +0800 Subject: [PATCH 1/2] Add new workflow --- .github/workflows/isanewworkflow.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/isanewworkflow.yml diff --git a/.github/workflows/isanewworkflow.yml b/.github/workflows/isanewworkflow.yml new file mode 100644 index 0000000000..b556181d7e --- /dev/null +++ b/.github/workflows/isanewworkflow.yml @@ -0,0 +1,16 @@ +name: Isabelle new workflow + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.404' + - name: Build and test + run: dotnet build && dotnet test From 9a269ea22ed9b154ed80b869d57848bc53a71619 Mon Sep 17 00:00:00 2001 From: Isabelle Seah Date: Fri, 28 Apr 2023 20:57:37 +0800 Subject: [PATCH 2/2] commit first --- .../workflows/delete-old-workflow-runs.yml | 47 ------------ .github/workflows/isanewworkflow.yml | 13 ++-- .github/workflows/publish-nightly.yml | 75 ------------------- .github/workflows/publish-release.yml | 65 ---------------- 4 files changed, 7 insertions(+), 193 deletions(-) delete mode 100644 .github/workflows/delete-old-workflow-runs.yml delete mode 100644 .github/workflows/publish-nightly.yml delete mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/delete-old-workflow-runs.yml b/.github/workflows/delete-old-workflow-runs.yml deleted file mode 100644 index 0c4672d5c3..0000000000 --- a/.github/workflows/delete-old-workflow-runs.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Delete old workflow runs -on: - schedule: - # Run monthly, at 00:00 on the 1st day of month. - - cron: '0 0 1 * *' - workflow_dispatch: - inputs: - days: - description: 'Number of days.' - required: true - default: '30' - minimum_runs: - description: 'The minimum runs to keep for each workflow.' - required: true - default: '6' - delete_workflow_pattern: - description: 'The name or filename of the workflow. if not set then it will target all workflows.' - required: false - delete_workflow_by_state_pattern: - description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' - required: true - default: "All" - type: choice - options: - - "All" - - active - - deleted - - disabled_inactivity - - disabled_manually - dry_run: - description: 'Only log actions, do not perform any delete operations.' - required: false - -jobs: - del_runs: - runs-on: ubuntu-latest - steps: - - name: Delete workflow runs - uses: Mattraks/delete-workflow-runs@v2 - with: - token: ${{ github.token }} - repository: ${{ github.repository }} - retain_days: ${{ github.event.inputs.days }} - keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} - delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} - delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} - dry_run: ${{ github.event.inputs.dry_run }} diff --git a/.github/workflows/isanewworkflow.yml b/.github/workflows/isanewworkflow.yml index b556181d7e..004d2d3f51 100644 --- a/.github/workflows/isanewworkflow.yml +++ b/.github/workflows/isanewworkflow.yml @@ -1,16 +1,17 @@ name: Isabelle new workflow -on: [push] +on: + push: jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: - dotnet-version: '3.1.404' - - name: Build and test - run: dotnet build && dotnet test + dotnet-version: 6.0.x + - name: Build + run: dotnet build /Users/isabelle/Desktop/ShoppingCart/Smartstore/Smartstore.sln diff --git a/.github/workflows/publish-nightly.yml b/.github/workflows/publish-nightly.yml deleted file mode 100644 index 3d2da6d2a1..0000000000 --- a/.github/workflows/publish-nightly.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Publish nightly dev Docker image - -on: - # Manual trigger - workflow_dispatch: - # At 06:00 AM, on Tuesday, Thursday, and Saturday - schedule: - - cron: "0 6 * * TUE,THU,SAT" - -env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - -jobs: - - publish-nightly: - name: Build, Test, Publish and Deploy nightly Docker image - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 7.0.x - include-prerelease: true - - - name: Build - run: dotnet build Smartstore.sln -c Release - - - name: Test - run: dotnet test Smartstore.sln -c Release --no-restore --no-build - - - name: Log in to the GitHub Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - #- name: Log in to Docker Hub - # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Publish and Push for Linux - if: matrix.os == 'ubuntu-latest' - run: | - dotnet publish src/Smartstore.Web/Smartstore.Web.csproj -c Release -o ./.build/release --no-restore --no-build --no-self-contained - docker build --build-arg SOURCE=./.build/release -f NoBuild.Dockerfile -t ghcr.io/smartstore/smartstore-linux:nightly . - docker push ghcr.io/smartstore/smartstore-linux:nightly - #docker build --build-arg VERSION=nightly -f NoBuild.Dockerfile -t smartstore/smartstore-linux:nightly . - #docker push smartstore/smartstore-linux:nightly - - - name: Publish and Push for Windows - if: matrix.os == 'windows-latest' - run: | - dotnet publish src/Smartstore.Web/Smartstore.Web.csproj -c Release -o ./.build/release --no-restore --no-build --no-self-contained - docker build --build-arg SOURCE=./.build/release -f Nano.Dockerfile -t ghcr.io/smartstore/smartstore-windows:nightly . - docker push ghcr.io/smartstore/smartstore-windows:nightly - #docker build --build-arg VERSION=nightly -f NoBuild.Dockerfile -t smartstore/smartstore-windows:nightly . - #docker push smartstore/smartstore-windows:nightly diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml deleted file mode 100644 index 2c318ed1a9..0000000000 --- a/.github/workflows/publish-release.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Publish release Docker image - -on: - # Manual trigger - workflow_dispatch: - inputs: - version: - description: 'Version, e.g. 5.0.4' - required: true - -env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - -jobs: - - publish-release: - name: Build, Publish and Deploy stable release Docker image - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - include-prerelease: false - - - name: Build - run: dotnet build Smartstore.sln -c Release - - - name: Log in to the GitHub Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish and Push for Linux - if: matrix.os == 'ubuntu-latest' - run: | - dotnet publish src/Smartstore.Web/Smartstore.Web.csproj -c Release -o ./.build/release --no-restore --no-build --no-self-contained - docker build --build-arg SOURCE=./.build/release -f NoBuild.Dockerfile -t ghcr.io/smartstore/smartstore-linux:latest -t ghcr.io/smartstore/smartstore-linux:${{ github.event.inputs.version }} . - docker push ghcr.io/smartstore/smartstore-linux:latest - docker push ghcr.io/smartstore/smartstore-linux:${{ github.event.inputs.version }} - - - name: Publish and Push for Windows - if: matrix.os == 'windows-latest' - run: | - dotnet publish src/Smartstore.Web/Smartstore.Web.csproj -c Release -o ./.build/release --no-restore --no-build --no-self-contained - docker build --build-arg SOURCE=./.build/release -f Nano.Dockerfile -t ghcr.io/smartstore/smartstore-windows:latest -t ghcr.io/smartstore/smartstore-windows:${{ github.event.inputs.version }} . - docker push ghcr.io/smartstore/smartstore-windows:latest - docker push ghcr.io/smartstore/smartstore-windows:${{ github.event.inputs.version }}