Skip to content

Commit 9ec4344

Browse files
author
Pat
authored
workflows: add source packages to releases (#5584)
* workflows: add source packages to releases Signed-off-by: Patrick Stephens <[email protected]> * workflows: fix linting Signed-off-by: Patrick Stephens <[email protected]>
1 parent 7e9afa8 commit 9ec4344

File tree

2 files changed

+72
-6
lines changed

2 files changed

+72
-6
lines changed

.github/actions/release-server-sync/action.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ runs:
6464
run: |
6565
ssh $USERNAME@$HOST mkdir -p /home/$USERNAME/apt
6666
rsync --include="*/" \
67-
--include="*.rpm" \
68-
--include="*.deb" \
69-
--include="*.exe" \
70-
--include="*.zip" \
67+
--include="*.rpm" --include="*.deb" \
68+
--include="*.zip" --include="*.exe" \
69+
--include="*.tar.gz" \
70+
--include="*.md5" --include="*.sha256" \
7171
--include="fluent-bit-schema*.json" \
72-
--exclude="*" -amvz \
73-
packaging/releases/ $USERNAME@$HOST:/home/$USERNAME/apt
72+
--exclude="*" \
73+
-amvz packaging/releases/ $USERNAME@$HOST:/home/$USERNAME/apt
7474
env:
7575
HOST: ${{ inputs.server_hostname }}
7676
USERNAME: ${{ inputs.server_username }}

.github/workflows/call-build-linux-packages.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,72 @@ jobs:
7272
echo ::set-output name=BUILD_TYPE::$BUILD_TYPE
7373
shell: bash
7474

75+
call-build-capture-source:
76+
# Capture source tarball and generate checksum for it
77+
name: Extract any supporting metadata
78+
runs-on: ubuntu-latest
79+
environment: ${{ inputs.environment }}
80+
needs:
81+
- call-build-legacy-check
82+
permissions:
83+
contents: read
84+
steps:
85+
- name: Checkout code
86+
uses: actions/checkout@v3
87+
with:
88+
ref: ${{ inputs.ref }}
89+
path: source
90+
91+
- name: Checkout legacy packaging code
92+
if: needs.call-build-legacy-check.outputs.build-type == '1.8'
93+
uses: actions/checkout@v3
94+
with:
95+
repository: fluent/fluent-bit-packaging
96+
path: packaging
97+
98+
- name: Create tarball and checksums
99+
run: |
100+
tar -czvf $SOURCE_FILENAME_PREFIX.tar.gz -C source --exclude-vcs .
101+
md5sum $SOURCE_FILENAME_PREFIX.tar.gz > $SOURCE_FILENAME_PREFIX.tar.gz.md5
102+
sha256sum $SOURCE_FILENAME_PREFIX.tar.gz > $SOURCE_FILENAME_PREFIX.tar.gz.sha256
103+
if [[ -d packaging ]]; then
104+
echo "Also adding 1.8 packaging code"
105+
tar -czvf $SOURCE_FILENAME_PREFIX-packaging.tar.gz -C packaging --exclude-vcs .
106+
md5sum $SOURCE_FILENAME_PREFIX-packaging.tar.gz > $SOURCE_FILENAME_PREFIX-packaging.tar.gz.md5
107+
sha256sum $SOURCE_FILENAME_PREFIX-packaging.tar.gz > $SOURCE_FILENAME_PREFIX-packaging.tar.gz.sha256
108+
fi
109+
# Move to a directory to simplify upload/sync
110+
mkdir -p source-packages
111+
cp -fv $SOURCE_FILENAME_PREFIX* source-packages/
112+
shell: bash
113+
env:
114+
SOURCE_FILENAME_PREFIX: source-${{ inputs.version }}
115+
116+
- name: Upload the source artifacts
117+
uses: actions/upload-artifact@v3
118+
with:
119+
name: source-${{ inputs.version }}
120+
path: source-packages/*
121+
if-no-files-found: error
122+
123+
# Required to support 1.8 style builds which will not have it
124+
- name: Checkout code for action
125+
if: inputs.environment == 'staging'
126+
uses: actions/checkout@v3
127+
with:
128+
path: action-support
129+
130+
- name: Push tarballs to S3
131+
# Only upload for staging
132+
if: inputs.environment == 'staging'
133+
uses: ./action-support/.github/actions/sync-to-bucket
134+
with:
135+
bucket: ${{ secrets.bucket }}
136+
access_key_id: ${{ secrets.access_key_id }}
137+
secret_access_key: ${{ secrets.secret_access_key }}
138+
bucket-directory: "${{ inputs.version }}/source"
139+
source-directory: "source-packages/"
140+
75141
# We build both master/1.9 and 1.8 style packages in a single job as it is simpler to keep all the custom
76142
# code and workflow together. We need to run the dependent job after this as well.
77143
call-build-linux-packages:

0 commit comments

Comments
 (0)