Skip to content

Commit

Permalink
add sha256sum file to release assets
Browse files Browse the repository at this point in the history
Signed-off-by: bo.jiang <[email protected]>
  • Loading branch information
ErikJiang committed May 12, 2024
1 parent 8d76381 commit 95af04a
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 120 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/auto-release-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
packages: write
contents: write

call-sha256sum-gen:
needs: [call-offline-build, call-os-pkgs-build]
uses: ./.github/workflows/call-sha256sum-gen.yaml
secrets: inherit
permissions:
packages: write
contents: write

sync-charts-and-api:
needs: [call-images-build, call-offline-build, call-os-pkgs-build]
uses: ./.github/workflows/call-sync-repos.yaml
Expand Down
64 changes: 39 additions & 25 deletions .github/workflows/call-offline-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
run: |
echo "SPRAY_VERSION=$(yq ".kubespray_version" version.yml)" >> ${GITHUB_ENV}
echo "KUBE_VERSION=$(yq ".kubernetes_version" version.yml)" >> ${GITHUB_ENV}
echo "SHA256SUM_TXT=sha256sum-offline-${{ github.ref_name }}.txt" >> ${GITHUB_ENV}
- name: Git clone kubespray repo
uses: actions/checkout@v3
Expand All @@ -37,6 +38,11 @@ jobs:
./artifacts/gen_airgap_crs.py LocalArtifactSet
cp artifacts/import_iso.sh ${KUBEAN_TAG}/
pushd ${KUBEAN_TAG}
sha256sum localartifactset.cr.yaml >> ../${{ env.SHA256SUM_TXT }}
sha256sum import_iso.sh >> ../${{ env.SHA256SUM_TXT }}
popd
echo "localartifactset cr output:"
cat ${KUBEAN_TAG}/localartifactset.cr.yaml
echo "manifest cr output:"
Expand All @@ -53,41 +59,48 @@ jobs:
python3 -m pip install --no-cache-dir -r requirements.txt
cd ../
- name: Generate binaries & images offline packages (amd64)
- name: Generate binaries & images offline packages (amd64/arm64)
env:
KUBEAN_TAG: ${{ github.ref_name }}
ARCH: amd64
KUBE_VERSION: ${{ env.KUBE_VERSION }}
run: |
OFFLINE_PACKAGE_DIR=${KUBEAN_TAG}/${ARCH}
bash artifacts/gen_airgap_pkgs.sh all
cd ${OFFLINE_PACKAGE_DIR}/
tar -zcvf files-${ARCH}-${KUBEAN_TAG}.tar.gz files/
tar -zcvf images-${ARCH}-${KUBEAN_TAG}.tar.gz images/
mv files.list files-${ARCH}.list
mv images.list images-${ARCH}.list
cd ../../
tree ${KUBEAN_TAG}/
function gen_airgap_pkgs() {
export ARCH=$1
export OFFLINE_PACKAGE_DIR=${KUBEAN_TAG}/${ARCH}
bash artifacts/gen_airgap_pkgs.sh all
pushd ${OFFLINE_PACKAGE_DIR}
tar -zcvf files-${ARCH}-${KUBEAN_TAG}.tar.gz files/
tar -zcvf images-${ARCH}-${KUBEAN_TAG}.tar.gz images/
mv files.list files-${ARCH}.list
mv images.list images-${ARCH}.list
sha256sum files-${ARCH}-${KUBEAN_TAG}.tar.gz >> ../../${{ env.SHA256SUM_TXT }}
sha256sum images-${ARCH}-${KUBEAN_TAG}.tar.gz >> ../../${{ env.SHA256SUM_TXT }}
sha256sum files-${ARCH}.list >> ../../${{ env.SHA256SUM_TXT }}
sha256sum images-${ARCH}.list >> ../../${{ env.SHA256SUM_TXT }}
popd
}
for arch in 'amd64' 'arm64'; do
gen_airgap_pkgs "${arch}"
done
- name: Generate binaries & images offline packages (arm64)
env:
KUBEAN_TAG: ${{ github.ref_name }}
ARCH: arm64
KUBE_VERSION: ${{ env.KUBE_VERSION }}
run: |
OFFLINE_PACKAGE_DIR=${KUBEAN_TAG}/${ARCH}
bash artifacts/gen_airgap_pkgs.sh all
cd ${OFFLINE_PACKAGE_DIR}/
tar -zcvf files-${ARCH}-${KUBEAN_TAG}.tar.gz files/
tar -zcvf images-${ARCH}-${KUBEAN_TAG}.tar.gz images/
mv files.list files-${ARCH}.list
mv images.list images-${ARCH}.list
cd ../../
tree ${KUBEAN_TAG}/
echo -e "\noutput files size:\n"
ls -lh ${KUBEAN_TAG}/amd64/
ls -lh ${KUBEAN_TAG}/arm64/
- name: Upload offline sha256sum file
uses: actions/upload-artifact@v4
with:
name: offline-sha256sum-key
retention-days: 1
path: |
${{ env.SHA256SUM_TXT }}
- name: Release and upload packages
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
Expand All @@ -105,3 +118,4 @@ jobs:
with:
path: charts/kubean/templates/manifest.cr.yaml
name: info-manifest-cr-file
retention-days: 1
50 changes: 23 additions & 27 deletions .github/workflows/call-os-pkgs-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,22 @@ name: OS Packages Build
on: workflow_call

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "matrix=$(jq -c . < .github/workflows/os-pkgs-matrix.json)" >> $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: matrix
strategy:
fail-fast: false
matrix:
include:
- name: centos7
dockerfile: build/os-packages/Dockerfile.centos7
- name: redhat7
dockerfile: build/os-packages/Dockerfile.redhat7
- name: redhat8
dockerfile: build/os-packages/Dockerfile.redhat8
- name: redhat9
dockerfile: build/os-packages/Dockerfile.redhat9
- name: rocky9
dockerfile: build/os-packages/Dockerfile.rocky9
- name: kylinv10
dockerfile: build/os-packages/Dockerfile.kylinv10
- name: openeuler22.03
dockerfile: build/os-packages/Dockerfile.openeuler22.03
- name: oracle8
dockerfile: build/os-packages/Dockerfile.oracle8
- name: oracle9
dockerfile: build/os-packages/Dockerfile.oracle9
- name: tencent31
dockerfile: build/os-packages/Dockerfile.tencent31
- name: ubuntu1804
dockerfile: build/os-packages/Dockerfile.ubuntu1804
- name: ubuntu2004
dockerfile: build/os-packages/Dockerfile.ubuntu2004
- name: ubuntu2204
dockerfile: build/os-packages/Dockerfile.ubuntu2204
include: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -87,6 +71,18 @@ jobs:
cp artifacts/import_ospkgs.sh os-pkgs/
tar -I pigz -cf os-pkgs-${{ matrix.name }}-${{ github.ref_name }}.tar.gz os-pkgs/ --remove-files
- name: Generate sha256sum file
run: |
sha256sum os-pkgs-${{ matrix.name }}-${{ github.ref_name }}.tar.gz > sha256sum-os-pkg-${{ matrix.name }}-${{ github.ref_name }}.txt
- name: Upload os-pkgs sha256sum file
uses: actions/upload-artifact@v4
with:
name: os-pkgs-sha256sum-${{ matrix.name }}-key
retention-days: 1
path: |
sha256sum-os-pkg-${{ matrix.name }}-${{ github.ref_name }}.txt
- name: Release and upload packages
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/call-sha256sum-gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Assets sha256sum Generate

on: workflow_call

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "matrix=$(jq -c . < .github/workflows/os-pkgs-matrix.json)" >> $GITHUB_OUTPUT
os-pkgs-sha256sum:
runs-on: ubuntu-latest
needs: matrix
strategy:
fail-fast: true
max-parallel: 1
matrix:
include: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- name: Download os-pkgs sha256sum files
uses: actions/download-artifact@v4
with:
name: os-pkgs-sha256sum-${{ matrix.name }}-key
- name: Download offline sha256sum file
uses: actions/download-artifact@v4
with:
name: offline-sha256sum-key
- name: Integrate all sha256sum for os-pkgs
run: |
cat sha256sum-os-pkg-${{ matrix.name }}-${{ github.ref_name }}.txt >> sha256sum-offline-${{ github.ref_name }}.txt
- name: Upload offline sha256sum file
uses: actions/upload-artifact@v4
with:
name: offline-sha256sum-key
overwrite: true
retention-days: 1
path: |
sha256sum-offline-${{ github.ref_name }}.txt
upload-sha256sum-file:
runs-on: ubuntu-latest
needs: os-pkgs-sha256sum
steps:
- name: Download offline sha256sum file
uses: actions/download-artifact@v4
with:
name: offline-sha256sum-key
- name: Rename sha256sum
run: |
mv sha256sum-offline-${{ github.ref_name }}.txt sha256sum.txt
- name: upload sha256sum file
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
sha256sum.txt
68 changes: 0 additions & 68 deletions .github/workflows/call-upload-qiniu.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/os-pkgs-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{ "name": "redhat7", "dockerfile":"build/os-packages/Dockerfile.redhat7"},
{ "name": "redhat8", "dockerfile":"build/os-packages/Dockerfile.redhat8"},
{ "name": "redhat9", "dockerfile":"build/os-packages/Dockerfile.redhat9"},
{ "name": "rocky9", "dockerfile":"build/os-packages/Dockerfile.rocky9"},
{ "name": "kylinv10", "dockerfile":"build/os-packages/Dockerfile.kylinv10"},
{ "name": "openeuler22.03", "dockerfile":"build/os-packages/Dockerfile.openeuler22.03"},
{ "name": "oracle8", "dockerfile":"build/os-packages/Dockerfile.oracle8"},
{ "name": "oracle9", "dockerfile":"build/os-packages/Dockerfile.oracle9"},
{ "name": "tencent31", "dockerfile":"build/os-packages/Dockerfile.tencent31"},
{ "name": "ubuntu1804", "dockerfile":"build/os-packages/Dockerfile.ubuntu1804"},
{ "name": "ubuntu2004", "dockerfile":"build/os-packages/Dockerfile.ubuntu2004"},
{ "name": "ubuntu2204", "dockerfile":"build/os-packages/Dockerfile.ubuntu2204"}
]

0 comments on commit 95af04a

Please sign in to comment.