From 161d619d5ceae5d97a77153c669ce56693b30ddd Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 15:28:58 +0000 Subject: [PATCH 1/7] workflows: add nightly unstable builds Signed-off-by: Patrick Stephens --- .../generate-package-build-matrix/action.yaml | 38 ++++ .github/workflows/call-test-packages.yaml | 5 + .github/workflows/cron-unstable-build.yaml | 190 ++++++++++++++++++ .github/workflows/staging-build.yaml | 96 +-------- 4 files changed, 238 insertions(+), 91 deletions(-) create mode 100644 .github/actions/generate-package-build-matrix/action.yaml create mode 100644 .github/workflows/cron-unstable-build.yaml diff --git a/.github/actions/generate-package-build-matrix/action.yaml b/.github/actions/generate-package-build-matrix/action.yaml new file mode 100644 index 00000000000..714261046c7 --- /dev/null +++ b/.github/actions/generate-package-build-matrix/action.yaml @@ -0,0 +1,38 @@ + +name: Composite action to generate the matrix of targets to build packages for. +description: Remove any duplication of this information so we only have to update in one place. + +inputs: + target: + description: Override to build a single target for debug/test only. + required: false +outputs: + build-matrix: + description: The build matrix we have created. + value: ${{ steps.set-matrix.outputs.matrix }} +runs: + using: "composite" + steps: + - id: set-matrix + run: | + matrix=$(( + echo '{ "distro" : [' + echo '"amazonlinux/2", "amazonlinux/2.arm64v8",' + echo '"centos/7", "centos/7.arm64v8", "centos/8", "centos/8.arm64v8",' + echo '"debian/buster", "debian/buster.arm64v8", "debian/bullseye", "debian/bullseye.arm64v8",' + echo '"ubuntu/16.04", "ubuntu/18.04", "ubuntu/20.04", "ubuntu/18.04.arm64v8", "ubuntu/20.04.arm64v8",' + echo '"raspbian/buster", "raspbian/bullseye"' + echo ']}' + ) | jq -c .) + if [ -n "${{ inputs.target || '' }}" ]; then + echo "Overriding matrix to build: ${{ inputs.target }}" + matrix=$(( + echo '{ "distro" : [' + echo '"${{ inputs.target }}"' + echo ']}' + ) | jq -c .) + fi + echo $matrix + echo $matrix| jq . + echo "::set-output name=matrix::$matrix" + shell: bash diff --git a/.github/workflows/call-test-packages.yaml b/.github/workflows/call-test-packages.yaml index 43f8ff147ea..efd7f9eb52b 100644 --- a/.github/workflows/call-test-packages.yaml +++ b/.github/workflows/call-test-packages.yaml @@ -7,6 +7,11 @@ on: description: The Github environment to run this workflow on. type: string required: false + ref: + description: The commit, tag or branch to checkout for testing scripts. + type: string + default: master + required: false secrets: token: description: The Github token or similar to authenticate with. diff --git a/.github/workflows/cron-unstable-build.yaml b/.github/workflows/cron-unstable-build.yaml new file mode 100644 index 00000000000..7f6b6be00ba --- /dev/null +++ b/.github/workflows/cron-unstable-build.yaml @@ -0,0 +1,190 @@ +--- +name: Unstable build + +on: + workflow_dispatch: + inputs: + branch: + description: The branch to create an unstable release for/from. + type: string + default: master + required: true + + # Run nightly build at this time, bit of trial and error but this seems good. + schedule: + - cron: "0 6 * * *" # master build + - cron: "0 12 * * *" # 1.9 build + - cron: "0 18 * * *" # 1.8 build + +# We do not want a new unstable build to run whilst we are releasing the current unstable build. +concurrency: unstable-build-release + +jobs: + + # This job provides this metadata for the other jobs to use. + unstable-build-get-meta: + name: Get metadata to add to build + runs-on: ubuntu-latest + outputs: + date: ${{ steps.date.outputs.date }} + branch: ${{ steps.branch.outputs.branch }} + steps: + # For cron builds, i.e. nightly, we provide date and time as extra parameter to distinguish them. + - name: Get current date + id: date + run: echo "::set-output name=date::$(date '+%Y-%m-%d-%H_%M_%S')" + + # Now we need to determine which branch to build + - name: Manual run - get branch + if: github.event_name == 'workflow_dispatch' + run: | + echo "::set-env name=cron_branch::${{ github.event.inputs.branch }}" + shell: bash + + - name: master run + if: github.event_name == 'schedule' && github.event.schedule=='*/6 * * * *' # set-env value + run: | + echo "::set-env name=cron_branch::master" + shell: bash + + - name: 1.9 run + if: github.event_name == 'schedule' && github.event.schedule=='*/12 * * * *' # set env value + run: | + echo "::set-env name=cron_branch::1.9" + shell: bash + + - name: 1.8 run + if: github.event_name == 'schedule' && github.event.schedule=='*/18 * * * *' # set env value + run: | + echo "::set-env name=cron_branch::1.8" + shell: bash + + - name: Output the branch to use + id: branch + run: | + echo "$cron_branch" + echo "::set-output name=branch::$cron_branch" + shell: bash + + unstable-build-images: + needs: unstable-build-get-meta + uses: fluent/fluent-bit/.github/workflows/call-build-images.yaml@master + with: + ref: ${{ needs.unstable-build-get-meta.outputs.branch }} + registry: ghcr.io + username: ${{ github.actor }} + image: ${{ github.repository }}/unstable + environment: unstable + unstable: ${{ needs.unstable-build-get-meta.outputs.date }} + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + + unstable-build-generate-schema: + # Not available for 1.8 + if: github.event.schedule != '*/18 * * * *' + needs: + - unstable-build-get-meta + - unstable-build-images + runs-on: ubuntu-latest + steps: + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - run: | + docker run --rm -it ${{ github.repository }}/unstable:${{ needs.unstable-build-get-meta.outputs.branch }} -J > fluent-bit-schema.json + cat fluent-bit-schema.json | jq -M > fluent-bit-schema-pretty.json + shell: bash + + - name: Upload the schema + uses: actions/upload-artifact@v2 + with: + name: fluent-bit-schema*.json + if-no-files-found: error + + unstable-build-generate-matrix: + name: unstable build matrix + runs-on: ubuntu-latest + outputs: + build-matrix: ${{ steps.set-matrix.outputs.build-matrix }} + steps: + # Set up the list of target to build so we can pass the JSON to the reusable job + - uses: ./.github/actions/generate-package-build-matrix + id: set-matrix + + unstable-build-packages: + needs: + - unstable-build-get-meta + - unstable-build-generate-matrix + uses: fluent/fluent-bit/.github/workflows/call-build-packages.yaml@master + with: + version: ${{ needs.unstable-build-get-meta.outputs.branch }} + ref: ${{ needs.unstable-build-get-meta.outputs.branch }} + build_matrix: ${{ needs.unstable-build-generate-matrix.outputs.build-matrix }} + environment: unstable + unstable: ${{ needs.unstable-build-get-meta.outputs.date }} + secrets: + token: ${{ secrets.GITHUB_TOKEN }} + + # We already detain all artefacts as build output so just capture for an unstable release + unstable-release: + runs-on: ubuntu-latest + needs: + - unstable-build-get-meta + - unstable-build-images + - unstable-build-packages + environment: unstable + permissions: + contents: write + steps: + - name: Download all artefacts + continue-on-error: true + uses: actions/download-artifact@v2 + with: + path: artifacts/ + + - name: Single packages tar + run: | + mkdir -p release-upload + mv -f artifacts/*.json release-upload/ + tar -czvf release-upload/packages-unstable-${{ needs.unstable-build-get-meta.outputs.branch }}.tar.gz -C artifacts/ . + shell: bash + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull containers as well (single arch only) + # May not be any/valid so ignore errors + continue-on-error: true + run: | + docker pull ghcr.io/${{ github.repository }}/unstable:${{ needs.unstable-build-get-meta.outputs.branch }} + docker save --output container-${{ needs.unstable-build-get-meta.outputs.branch }}.tar ghcr.io/${{ github.repository }}/unstable:${{ needs.unstable-build-get-meta.outputs.branch }} + docker pull ghcr.io/${{ github.repository }}/unstable:${{ needs.unstable-build-get-meta.outputs.branch }}-debug + docker save --output container-${{ needs.unstable-build-get-meta.outputs.branch }}-debug.tar ghcr.io/${{ github.repository }}/unstable:${{ needs.unstable-build-get-meta.outputs.branch }}-debug + shell: bash + working-directory: release-upload + + - name: Display structure of files to upload + run: ls -R + working-directory: release-upload + shell: bash + + - name: Remove any existing release + continue-on-error: true + run: gh release delete unstable-${{ needs.unstable-build-get-meta.outputs.branch }} --yes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + + - name: Create Release + run: gh release create unstable-${{ needs.unstable-build-get-meta.outputs.branch }} release-upload/*.* --generate-notes --prerelease --target ${{ needs.unstable-build-get-meta.outputs.branch }} --title "Nightly unstable ${{ needs.unstable-build-get-meta.outputs.branch }} build" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash diff --git a/.github/workflows/staging-build.yaml b/.github/workflows/staging-build.yaml index ccb9dac46ea..b3cd0964746 100644 --- a/.github/workflows/staging-build.yaml +++ b/.github/workflows/staging-build.yaml @@ -17,10 +17,6 @@ on: required: false default: "" - # Run nightly build - disable until after 1.9 release - # schedule: - # - cron: "0 6 * * *" - # We do not want a new staging build to run whilst we are releasing the current staging build. # We also do not want multiples to run for the same version. concurrency: staging-build-release @@ -69,11 +65,6 @@ jobs: replace-with: '$1' flags: 'g' - # For cron builds, i.e. nightly, we provide date and time as extra parameter to distinguish them. - - name: Get current date - id: date - run: echo "::set-output name=date::$(date '+%Y-%m-%d-%H_%M_%S')" - staging-build-images: needs: staging-build-get-meta uses: fluent/fluent-bit/.github/workflows/call-build-images.yaml@master @@ -84,7 +75,6 @@ jobs: username: ${{ github.actor }} image: ${{ github.repository }}/staging environment: staging - unstable: ${{ github.event_name == 'schedule' && needs.staging-build-get-meta.outputs.date || '' }} secrets: token: ${{ secrets.GITHUB_TOKEN }} cosign_private_key: ${{ secrets.COSIGN_PRIVATE_KEY }} @@ -94,32 +84,13 @@ jobs: name: Staging build matrix runs-on: ubuntu-latest outputs: - build-matrix: ${{ steps.set-matrix.outputs.matrix }} + build-matrix: ${{ steps.set-matrix.outputs.build-matrix }} steps: # Set up the list of target to build so we can pass the JSON to the reusable job - - id: set-matrix - run: | - matrix=$(( - echo '{ "distro" : [' - echo '"amazonlinux/2", "amazonlinux/2.arm64v8",' - echo '"centos/7", "centos/7.arm64v8", "centos/8", "centos/8.arm64v8",' - echo '"debian/buster", "debian/buster.arm64v8", "debian/bullseye", "debian/bullseye.arm64v8",' - echo '"ubuntu/16.04", "ubuntu/18.04", "ubuntu/20.04", "ubuntu/18.04.arm64v8", "ubuntu/20.04.arm64v8",' - echo '"raspbian/buster", "raspbian/bullseye"' - echo ']}' - ) | jq -c .) - if [ -n "${{ github.event.inputs.target || '' }}" ]; then - echo "Overriding matrix to build: ${{ github.event.inputs.target }}" - matrix=$(( - echo '{ "distro" : [' - echo '"${{ github.event.inputs.target }}"' - echo ']}' - ) | jq -c .) - fi - echo $matrix - echo $matrix| jq . - echo "::set-output name=matrix::$matrix" - shell: bash + - uses: ./.github/actions/generate-package-build-matrix + id: set-matrix + with: + target: ${{ github.event.inputs.target || '' }} staging-build-packages: needs: [ staging-build-get-meta, staging-build-generate-matrix ] @@ -129,7 +100,6 @@ jobs: ref: ${{ github.event.inputs.version || github.ref_name }} build_matrix: ${{ needs.staging-build-generate-matrix.outputs.build-matrix }} environment: staging - unstable: ${{ github.event_name == 'schedule' && needs.staging-build-get-meta.outputs.date || '' }} secrets: token: ${{ secrets.GITHUB_TOKEN }} bucket: ${{ secrets.AWS_S3_BUCKET_STAGING }} @@ -137,59 +107,3 @@ jobs: secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_private_key_passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} - - # We already detain all artefacts as build output so just capture for an unstable release - staging-unstable-release: - runs-on: ubuntu-latest - needs: - - staging-build-get-meta - - staging-build-images - - staging-build-packages - environment: staging - permissions: - contents: write - steps: - - name: Download all artefacts - continue-on-error: true - uses: actions/download-artifact@v2 - with: - path: artifacts/ - - - name: Single packages tar - run: | - mkdir -p release-upload - tar -czvf release-upload/packages-unstable-${{ needs.staging-build-get-meta.outputs.version }}.tar.gz -C artifacts/ . - shell: bash - - - name: Log in to the Container registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Pull containers as well (single arch only) - # May not be any/valid so ignore errors - continue-on-error: true - run: | - docker pull ghcr.io/${{ github.repository }}/staging:${{ needs.staging-build-get-meta.outputs.version }} - docker save --output container-${{ needs.staging-build-get-meta.outputs.version }}.tar ghcr.io/${{ github.repository }}/staging:${{ needs.staging-build-get-meta.outputs.version }} - docker pull ghcr.io/${{ github.repository }}/staging:${{ needs.staging-build-get-meta.outputs.version }}-debug - docker save --output container-${{ needs.staging-build-get-meta.outputs.version }}-debug.tar ghcr.io/${{ github.repository }}/staging:${{ needs.staging-build-get-meta.outputs.version }}-debug - shell: bash - working-directory: release-upload - - - name: Display structure of files to upload - run: ls -R - working-directory: release-upload - shell: bash - - - name: Unstable release on push to master to make it easier to download - # Ignore failures here as we still want to trigger testing - continue-on-error: true - uses: pyTooling/Actions/releaser@r0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: 'unstable' - files: | - release-upload/**/* From 7bfd643e5dc23bfbcace884c9a4ab2e449066e77 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 15:31:06 +0000 Subject: [PATCH 2/7] packaging: bug fix for release Signed-off-by: Patrick Stephens --- packaging/update-repos.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packaging/update-repos.sh b/packaging/update-repos.sh index 7b09cac2d71..2622047e802 100755 --- a/packaging/update-repos.sh +++ b/packaging/update-repos.sh @@ -65,8 +65,7 @@ for DEB_REPO in "${DEB_REPO_PATHS[@]}"; do cat << EOF > "$APTLY_CONFIG" { - "rootDir": "$APTLY_ROOTDIR/", - "gpgDisableSign": $DISABLE_SIGNING, + "rootDir": "$APTLY_ROOTDIR/" } EOF cat "$APTLY_CONFIG" @@ -78,7 +77,11 @@ EOF aptly -config="$APTLY_CONFIG" repo add "$APTLY_REPO_NAME" "$REPO_DIR/" aptly -config="$APTLY_CONFIG" repo show "$APTLY_REPO_NAME" - aptly -config="$APTLY_CONFIG" publish repo -gpg-key="$GPG_KEY" "$APTLY_REPO_NAME" + if [[ "$DISABLE_SIGNING" != "true" ]]; then + aptly -config="$APTLY_CONFIG" publish repo -gpg-key="$GPG_KEY" "$APTLY_REPO_NAME" + else + aptly -config="$APTLY_CONFIG" publish repo --skip-signing "$APTLY_REPO_NAME" + fi rsync -av "$APTLY_ROOTDIR"/public/* "$REPO_DIR" # Remove unnecessary files rm -rf "$REPO_DIR/conf/" "$REPO_DIR/db/" "$APTLY_ROOTDIR" "$APTLY_CONFIG" From 18896c51124c82d4d896fbbca9863064ead6a984 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 15:40:51 +0000 Subject: [PATCH 3/7] workflows: add Windows CI Signed-off-by: Patrick Stephens --- .github/workflows/cron-unstable-build.yaml | 43 ++++++++++++ .github/workflows/windows-build.yaml | 80 ---------------------- 2 files changed, 43 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/windows-build.yaml diff --git a/.github/workflows/cron-unstable-build.yaml b/.github/workflows/cron-unstable-build.yaml index 7f6b6be00ba..2f57f9a47d2 100644 --- a/.github/workflows/cron-unstable-build.yaml +++ b/.github/workflows/cron-unstable-build.yaml @@ -129,6 +129,48 @@ jobs: secrets: token: ${{ secrets.GITHUB_TOKEN }} + unstable-build-windows-package: + needs: + - unstable-build-get-meta + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + ref: ${{ needs.unstable-build-get-meta.outputs.branch }} + + - name: Get dependencies + run: | + Invoke-WebRequest -O winflexbison.zip $env:WINFLEXBISON + Expand-Archive winflexbison.zip -Destination C:\WinFlexBison + Copy-Item -Path C:\WinFlexBison/win_bison.exe C:\WinFlexBison/bison.exe + Copy-Item -Path C:\WinFlexBison/win_flex.exe C:\WinFlexBison/flex.exe + echo "C:\WinFlexBison" | Out-File -FilePath $env:GITHUB_PATH -Append + env: + WINFLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip + shell: pwsh + + - name: Set up Visual Studio shell + uses: egor-tensin/vs-shell@v2 + with: + arch: x64 + + - name: Build Fluent Bit packages + run: | + cmake -G "NMake Makefiles" ../ + cmake --build . + cpack + working-directory: build + + - name: Upload build packages + uses: actions/upload-artifact@v2 + with: + name: windows-packages + path: | + build/fluent-bit-*.exe + build/fluent-bit-*.zip + if-no-files-found: error + # We already detain all artefacts as build output so just capture for an unstable release unstable-release: runs-on: ubuntu-latest @@ -136,6 +178,7 @@ jobs: - unstable-build-get-meta - unstable-build-images - unstable-build-packages + - unstable-build-windows-package environment: unstable permissions: contents: write diff --git a/.github/workflows/windows-build.yaml b/.github/workflows/windows-build.yaml deleted file mode 100644 index e539f0c9445..00000000000 --- a/.github/workflows/windows-build.yaml +++ /dev/null @@ -1,80 +0,0 @@ -name: Windows CI -on: - workflow_dispatch: - - pull_request: - # Limit to just those changes that 'might' affect Windows for automated builds - # We can always do a manual build for a branch - paths: - - '**.h' - - '**.c' - - '**.windows' - - './conf/**' - - './cmake/**' - types: - - opened - - reopened - - synchronize - push: - branches: - - "master" - - "1.8" - -jobs: - windows-build-package: - runs-on: windows-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Get dependencies - run: | - Invoke-WebRequest -O winflexbison.zip $env:WINFLEXBISON - Expand-Archive winflexbison.zip -Destination C:\WinFlexBison - Copy-Item -Path C:\WinFlexBison/win_bison.exe C:\WinFlexBison/bison.exe - Copy-Item -Path C:\WinFlexBison/win_flex.exe C:\WinFlexBison/flex.exe - echo "C:\WinFlexBison" | Out-File -FilePath $env:GITHUB_PATH -Append - env: - WINFLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip - shell: pwsh - - - name: Set up Visual Studio shell - uses: egor-tensin/vs-shell@v2 - with: - arch: x64 - - - name: Build Fluent Bit packages - run: | - cmake -G "NMake Makefiles" ../ - cmake --build . - cpack - working-directory: build - - - name: Upload build packages - uses: actions/upload-artifact@v2 - with: - name: windows-packages - path: | - build/fluent-bit-*.exe - build/fluent-bit-*.zip - if-no-files-found: error - - windows-build-container: - # Only build on push as takes a long time and not needed for PRs - if: github.event_name != 'pull_request' - # Need to match the container base image - runs-on: windows-2019 - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - run: | - docker build -t fluent/fluent-bit:windows-${{ github.sha }} -f ./dockerfiles/Dockerfile.windows . - docker save -o windows-${{ github.sha }}.tar fluent/fluent-bit:windows-${{ github.sha }} - - - name: Upload containers - uses: actions/upload-artifact@v2 - with: - name: windows-containers - path: windows-${{ github.sha }}.tar - if-no-files-found: error From 17e3e9dbe40d03f811cba000c79e3ad5c605b3ef Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 15:40:57 +0000 Subject: [PATCH 4/7] workflows: add Windows CI Signed-off-by: Patrick Stephens --- .github/workflows/pr-windows-build.yaml | 76 +++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/pr-windows-build.yaml diff --git a/.github/workflows/pr-windows-build.yaml b/.github/workflows/pr-windows-build.yaml new file mode 100644 index 00000000000..8bb3b6aec25 --- /dev/null +++ b/.github/workflows/pr-windows-build.yaml @@ -0,0 +1,76 @@ +name: Windows CI +on: + workflow_dispatch: + + pull_request: + # Limit to just those changes that 'might' affect Windows for automated builds + # We can always do a manual build for a branch + paths: + - '**.h' + - '**.c' + - '**.windows' + - './conf/**' + - './cmake/**' + types: + - opened + - reopened + - synchronize + +jobs: + windows-build-package: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Get dependencies + run: | + Invoke-WebRequest -O winflexbison.zip $env:WINFLEXBISON + Expand-Archive winflexbison.zip -Destination C:\WinFlexBison + Copy-Item -Path C:\WinFlexBison/win_bison.exe C:\WinFlexBison/bison.exe + Copy-Item -Path C:\WinFlexBison/win_flex.exe C:\WinFlexBison/flex.exe + echo "C:\WinFlexBison" | Out-File -FilePath $env:GITHUB_PATH -Append + env: + WINFLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip + shell: pwsh + + - name: Set up Visual Studio shell + uses: egor-tensin/vs-shell@v2 + with: + arch: x64 + + - name: Build Fluent Bit packages + run: | + cmake -G "NMake Makefiles" ../ + cmake --build . + cpack + working-directory: build + + - name: Upload build packages + uses: actions/upload-artifact@v2 + with: + name: windows-packages + path: | + build/fluent-bit-*.exe + build/fluent-bit-*.zip + if-no-files-found: error + + windows-build-container: + # Only build on push as takes a long time and not needed for PRs + if: github.event_name != 'pull_request' + # Need to match the container base image + runs-on: windows-2019 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - run: | + docker build -t fluent/fluent-bit:windows-${{ github.sha }} -f ./dockerfiles/Dockerfile.windows . + docker save -o windows-${{ github.sha }}.tar fluent/fluent-bit:windows-${{ github.sha }} + + - name: Upload containers + uses: actions/upload-artifact@v2 + with: + name: windows-containers + path: windows-${{ github.sha }}.tar + if-no-files-found: error From c6dc3195f8c496eff178897aaf76217ebe7deb05 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 17:14:42 +0000 Subject: [PATCH 5/7] workflows: linting issues Signed-off-by: Patrick Stephens --- .github/workflows/cron-unstable-build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cron-unstable-build.yaml b/.github/workflows/cron-unstable-build.yaml index 2f57f9a47d2..886ffa270d9 100644 --- a/.github/workflows/cron-unstable-build.yaml +++ b/.github/workflows/cron-unstable-build.yaml @@ -102,6 +102,7 @@ jobs: - name: Upload the schema uses: actions/upload-artifact@v2 with: + path: ./ name: fluent-bit-schema*.json if-no-files-found: error From 75681777c89afaa486f68fd10859fbae3a026135 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 17:15:25 +0000 Subject: [PATCH 6/7] workflows: linting issues Signed-off-by: Patrick Stephens --- .github/workflows/staging-build.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/staging-build.yaml b/.github/workflows/staging-build.yaml index b3cd0964746..99e4217ce89 100644 --- a/.github/workflows/staging-build.yaml +++ b/.github/workflows/staging-build.yaml @@ -30,7 +30,6 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.formatted_version.outputs.replaced }} - date: ${{ steps.date.outputs.date }} steps: - run: | From a88f5a3a806774cc1819f68098b51a05e11c7b93 Mon Sep 17 00:00:00 2001 From: Patrick Stephens Date: Thu, 17 Mar 2022 17:33:17 +0000 Subject: [PATCH 7/7] packaging: handle repo updates better Signed-off-by: Patrick Stephens --- packaging/update-repos.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packaging/update-repos.sh b/packaging/update-repos.sh index 2622047e802..e005bc33232 100755 --- a/packaging/update-repos.sh +++ b/packaging/update-repos.sh @@ -74,8 +74,13 @@ EOF -component="main" \ -distribution="$CODENAME" \ "$APTLY_REPO_NAME" - - aptly -config="$APTLY_CONFIG" repo add "$APTLY_REPO_NAME" "$REPO_DIR/" + # Check if any files to add + count=$(find "$REPO_DIR" -maxdepth 1 -type f -name "*.deb" | wc -l) + if [[ $count != 0 ]] ; then + aptly -config="$APTLY_CONFIG" repo add -remove-files -force-replace "$APTLY_REPO_NAME" "$REPO_DIR/" + else + echo "No files to add in $DEB_REPO for $CODENAME" + fi aptly -config="$APTLY_CONFIG" repo show "$APTLY_REPO_NAME" if [[ "$DISABLE_SIGNING" != "true" ]]; then aptly -config="$APTLY_CONFIG" publish repo -gpg-key="$GPG_KEY" "$APTLY_REPO_NAME"