Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: windows release artefacts #5270

Merged
merged 17 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/call-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,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 @@ -78,6 +78,7 @@ jobs:

- 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@v2
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