Skip to content

Commit

Permalink
workflows: windows release artefacts (fluent#5270)
Browse files Browse the repository at this point in the history
* workflows: fix wildcard error

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: remove region

Signed-off-by: Patrick Stephens <[email protected]>

* packaging: add test and Windows scripts

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: add Windows container build

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: switch path separator

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: windows CI

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: remove --delete

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix schema upload

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: minor tweak

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: REVERT - test this branch

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: direct container build rather than action

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix Windows tags

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix Windows multi-line shell

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: remove buildx support on Windows

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: reverted branch for testing

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix linkage for MacOS

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: remove overwriting Windows latest version

Signed-off-by: Patrick Stephens <[email protected]>
Signed-off-by: Manal Geries <[email protected]>
  • Loading branch information
patrick-stephens authored and mgeriesa committed Oct 25, 2022
1 parent 4536475 commit b57c062
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/call-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,45 @@ jobs:
env:
COSIGN_PRIVATE_KEY: ${{ secrets.cosign_private_key }}
COSIGN_PASSWORD: ${{ secrets.cosign_private_key_password }} # optional

# This takes a long time...
call-build-windows-container:
name: Windows container image
runs-on: windows-2019
environment: ${{ inputs.environment }}
needs:
- call-build-legacy-check
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ secrets.token }}

- name: Build the production images
run: |
docker build -t ${{ inputs.registry }}/${{ inputs.image }}:windows-2019-${{ inputs.version }} --build-arg FLB_NIGHTLY_BUILD=${{ inputs.unstable }} --build-arg WINDOWS_VERSION=ltsc2019 -f ./dockerfiles/Dockerfile.windows .
docker push ${{ inputs.registry }}/${{ inputs.image }}:windows-2019-${{ inputs.version }}
# We cannot use this action as it requires privileged mode
# uses: docker/build-push-action@v2
# with:
# file: ./dockerfiles/Dockerfile.windows
# context: .
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# platforms: windows/amd64
# target: runtime
# push: true
# load: false
# build-args: |
# FLB_NIGHTLY_BUILD=${{ inputs.unstable }}
# WINDOWS_VERSION=ltsc2019
1 change: 1 addition & 0 deletions .github/workflows/call-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
brew install bison flex || true
- name: Build Fluent Bit packages
run: |
export LIBRARY_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib:$LIBRARY_PATH
cmake -DCPACK_GENERATOR=productbuild -DFLB_NIGHTLY_BUILD=${{ inputs.unstable }} ../
cmake --build .
cpack -G productbuild
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/call-build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,39 @@ jobs:
build/*-bit-*.zip
if-no-files-found: error

- name: Push packages to S3
call-build-windows-s3-upload:
name: Handle upload to S3
runs-on: ubuntu-latest
needs:
- call-build-windows-package
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}

- name: Download all artefacts
continue-on-error: true
uses: actions/download-artifact@v2
with:
path: artifacts/

- name: Set up Windows checksums
run: |
packaging/windows-checksums.sh
ls -lR artifacts/
shell: bash
env:
SOURCE_DIR: artifacts

- name: Push Windows packages to S3
# Only upload for staging
if: inputs.environment == 'staging'
run: |
aws s3 sync "build/*-bit-*.exe" "s3://${{ secrets.bucket }}/${{ inputs.version }}/windows/" --follow-symlinks --no-progress --delete
aws s3 sync "build/*-bit-*.zip" "s3://${{ secrets.bucket }}/${{ inputs.version }}/windows/" --follow-symlinks --no-progress
aws s3 sync "$SOURCE_DIR" "s3://$DEST_DIR" --follow-symlinks --no-progress
env:
SOURCE_DIR: "artifacts"
DEST_DIR: "${{ secrets.bucket }}/${{ inputs.version }}/windows/"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.access_key_id }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.secret_access_key }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/staging-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@ jobs:
uses: actions/download-artifact@v3
with:
name: fluent-bit-schema-${{ needs.staging-build-get-meta.outputs.version }}
path: artifacts/

- name: Display structure of downloaded files
run: ls -R
run: |
ls -R
shell: bash

- name: Push schema to S3 bucket
# We may have no schema so ignore that failure
continue-on-error: true
run: |
aws --region "$AWS_REGION" s3 sync *.json "s3://${AWS_S3_BUCKET}/${DEST_DIR}" --no-progress ${ENDPOINT}
aws s3 sync "artifacts/" "s3://${AWS_S3_BUCKET}/${DEST_DIR}" --no-progress
env:
DEST_DIR: "${{ needs.staging-build-get-meta.outputs.version }}/"
AWS_REGION: "us-east-1"
Expand Down
6 changes: 5 additions & 1 deletion packaging/server/publish-all.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if [ -z "$1" ]; then
exit 1
fi
VERSION="$1"
MAJOR_VERSION=${MAJOR_VERSION:-VERSION##\.*}

if [[ ! -d "$SOURCE_DIR" ]]; then
echo "Missing source directory: $SOURCE_DIR"
Expand Down Expand Up @@ -114,4 +115,7 @@ if ! aptly -config="$APTLY_CONFIG" publish switch -gpg-key="[email protected]
fi

# Sign YUM repo meta-data
find "/var/www/apt.fluentbit.io" -name repomd.xml -exec gpg --detach-sign --armor --yes -u "[email protected]" {} \;
find "/var/www/apt.fluentbit.io" -name repomd.xml -exec gpg --detach-sign --armor --yes -u "[email protected]" {} \;

# Windows
cp -v "$SOURCE_DIR/windows/*$VERSION*" /var/www/releases.fluentbit.io/releases/"$MAJOR_VERSION"/
10 changes: 10 additions & 0 deletions packaging/test-release-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eux
# Verify package install for a latest release version
docker run --rm -it ubuntu:20.04 sh -c "apt-get update && apt-get install -y sudo gpg curl;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it ubuntu:18.04 sh -c "apt-get update && apt-get install -y sudo gpg curl;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it debian:10 sh -c "apt-get update && apt-get install -y sudo gpg curl;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it debian:11 sh -c "apt-get update && apt-get install -y sudo gpg curl;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it centos:7 sh -c "yum install -y curl sudo;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it rockylinux:8 sh -c "yum install -y curl sudo;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
docker run --rm -it amazonlinux:2 sh -c "yum install -y curl sudo;curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh"
18 changes: 18 additions & 0 deletions packaging/windows-checksums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
set -eu

SOURCE_DIR=${SOURCE_DIR:?}

pushd "$SOURCE_DIR"
for i in *.exe
do
echo "$i"
sha256sum "$i" > "$i".sha256
done

for i in *.zip
do
echo "$i"
sha256sum "$i" > "$i".sha256
done
popd

0 comments on commit b57c062

Please sign in to comment.