From db69c865f1ac4fe555d0bd5b57dad9257ee93bd6 Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Sun, 9 Mar 2025 23:48:59 +0400 Subject: [PATCH 1/3] grok --- .github/workflows/ci-release.yml | 36 +++++++++++++++---------------- .github/workflows/ci-test-run.yml | 34 +++++++++-------------------- 2 files changed, 27 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index feb1a26a..31e433f2 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -15,24 +15,21 @@ jobs: - os: ubuntu-latest artifact: 'ubuntu' command: './_AutoinstallCreator/release.sh' - - os: windows-latest artifact: 'windows' command: './.tools/busybox.exe sh ./_AutoinstallCreator/release.sh' - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # need for self_count - - run: ${{ matrix.command }} + - name: Run release script id: create_artifact - - - uses: actions/upload-artifact@v3 + run: ${{ matrix.command }} + - uses: actions/upload-artifact@v4 with: name: AutoinstallCreator-${{ matrix.artifact }} path: ${{ steps.create_artifact.outputs.artifact_path }} - - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: body path: ./body.md @@ -49,23 +46,24 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} token: ${{ secrets.GITHUB_TOKEN }} timeoutSeconds: 1800 - - - name: setFailed when not wait-for-build - uses: actions/github-script@v6 + - name: Fail if build unsuccessful + uses: actions/github-script@v7 # Upgraded to v7 if: steps.wait-for-build.outputs.conclusion != 'success' with: script: | - core.setFailed('error: conclusion is ${{ steps.wait-for-build.outputs.conclusion }}') - - - uses: actions/checkout@v3 - - run: git push origin :refs/tags/latest-${{ github.base_ref || github.ref_name }} - - - uses: actions/download-artifact@v3 + core.setFailed('Error: Build conclusion is ${{ steps.wait-for-build.outputs.conclusion }}') + - uses: actions/checkout@v4 + - name: Delete existing tag + run: git push origin :refs/tags/latest-${{ github.base_ref || github.ref_name }} + continue-on-error: true # Avoid failure if tag doesn’t exist + - uses: actions/download-artifact@v4 + with: + path: artifacts # Explicit download path - uses: ncipollo/release-action@v1 with: tag: latest-${{ github.base_ref || github.ref_name }} - artifacts: ./AutoinstallCreator-*/* - bodyFile: ./body/body.md + artifacts: ./artifacts/AutoinstallCreator-*/* + bodyFile: ./artifacts/body/body.md allowUpdates: true removeArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-test-run.yml b/.github/workflows/ci-test-run.yml index 52f2cc6c..7b4a5b1d 100644 --- a/.github/workflows/ci-test-run.yml +++ b/.github/workflows/ci-test-run.yml @@ -12,24 +12,19 @@ jobs: runs-on: ${{ matrix.os }} env: IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64 - strategy: matrix: include: - os: ubuntu-latest container: 'ubuntu:22.04' artifact: 'ubuntu' - - os: ubuntu-latest container: 'alpine:3.15.0' artifact: 'alpine' - - os: windows-latest artifact: 'windows' - - os: windows-latest artifact: 'nanoserver' - container: ${{ matrix.container }} steps: - name: Install Ubuntu packages @@ -38,35 +33,29 @@ jobs: apt update apt install -y busybox dos2unix libarchive-tools python3 git git config --global --add safe.directory '*' - - name: Install Alpine packages if: matrix.artifact == 'alpine' run: | apk add --no-cache bash libarchive-tools python3 git git config --global --add safe.directory '*' - - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # need for self_count - - - name: ci test-run (non windows) + - name: CI test-run (non-Windows) if: matrix.os != 'windows-latest' run: .tests/ci-test-run.sh - - - name: ci test-run (windows) + - name: CI test-run (Windows) if: matrix.artifact == 'windows' shell: cmd run: | - rm -f "C:\Strawberry\perl\bin\shasum.BAT" + if exist "C:\Strawberry\perl\bin\shasum.BAT" del "C:\Strawberry\perl\bin\shasum.BAT" call .tests\ci-test-run.bat - - - name: pull (nanoserver) container ${{ env.IMAGE_NAME }} + - name: Pull Nanoserver container if: matrix.artifact == 'nanoserver' run: | docker pull ${{ env.IMAGE_NAME }} docker images ${{ env.IMAGE_NAME }} - - - name: ci test-run (nanoserver) + - name: CI test-run (Nanoserver) if: matrix.artifact == 'nanoserver' run: | docker container run --rm -e PATH="C:\Windows;C:\Windows\System32;C:\Python;C:\git\mingw64\bin" -v ${{ github.workspace }}:C:\app -w C:\app ${{ env.IMAGE_NAME }} C:\app\.tests\ci-test-run-nanoserver.bat @@ -74,7 +63,7 @@ jobs: test-create: needs: test runs-on: ${{ matrix.os }} - name: Run test-create + name: Run test-create (${{ matrix.os }}, ${{ matrix.artifact }}) strategy: matrix: include: @@ -83,16 +72,13 @@ jobs: - os: windows-latest artifact: 'windows' - container: ${{ matrix.container }} steps: - - uses: actions/checkout@v3 - - - name: External test-run (non windows) + - uses: actions/checkout@v4 + - name: External test-run (non-Windows) if: matrix.os != 'windows-latest' run: .tests/test-run.sh -- testExternalCreate - - - name: External test-run (windows) + - name: External test-run (Windows) if: matrix.os == 'windows-latest' shell: cmd run: call .tests\test-run.bat -- testExternalCreate From d358a15aaa46a402d1494b21115186ec7bc10813 Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Sun, 9 Mar 2025 23:55:07 +0400 Subject: [PATCH 2/3] t1 --- .github/workflows/ci-release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 31e433f2..df9cbb24 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -31,7 +31,7 @@ jobs: path: ${{ steps.create_artifact.outputs.artifact_path }} - uses: actions/upload-artifact@v4 with: - name: body + name: body-${{ matrix.artifact }} path: ./body.md upload_release: @@ -47,7 +47,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} timeoutSeconds: 1800 - name: Fail if build unsuccessful - uses: actions/github-script@v7 # Upgraded to v7 + uses: actions/github-script@v7 if: steps.wait-for-build.outputs.conclusion != 'success' with: script: | @@ -55,15 +55,15 @@ jobs: - uses: actions/checkout@v4 - name: Delete existing tag run: git push origin :refs/tags/latest-${{ github.base_ref || github.ref_name }} - continue-on-error: true # Avoid failure if tag doesn’t exist + continue-on-error: true - uses: actions/download-artifact@v4 with: - path: artifacts # Explicit download path + path: artifacts - uses: ncipollo/release-action@v1 with: tag: latest-${{ github.base_ref || github.ref_name }} artifacts: ./artifacts/AutoinstallCreator-*/* - bodyFile: ./artifacts/body/body.md + bodyFile: ./artifacts/body-ubuntu/body.md # Pick one, e.g., Ubuntu’s body allowUpdates: true removeArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} From 782c6e12e330d3eb3c8dfa855737cb36284316be Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Mon, 10 Mar 2025 00:00:30 +0400 Subject: [PATCH 3/3] ~ --- .github/workflows/ci-test-run.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-test-run.yml b/.github/workflows/ci-test-run.yml index 7b4a5b1d..f9205bee 100644 --- a/.github/workflows/ci-test-run.yml +++ b/.github/workflows/ci-test-run.yml @@ -50,12 +50,14 @@ jobs: run: | if exist "C:\Strawberry\perl\bin\shasum.BAT" del "C:\Strawberry\perl\bin\shasum.BAT" call .tests\ci-test-run.bat - - name: Pull Nanoserver container + + - name: pull (nanoserver) container ${{ env.IMAGE_NAME }} if: matrix.artifact == 'nanoserver' run: | docker pull ${{ env.IMAGE_NAME }} docker images ${{ env.IMAGE_NAME }} - - name: CI test-run (Nanoserver) + + - name: ci test-run (nanoserver) if: matrix.artifact == 'nanoserver' run: | docker container run --rm -e PATH="C:\Windows;C:\Windows\System32;C:\Python;C:\git\mingw64\bin" -v ${{ github.workspace }}:C:\app -w C:\app ${{ env.IMAGE_NAME }} C:\app\.tests\ci-test-run-nanoserver.bat