|
72 | 72 | echo ::set-output name=BUILD_TYPE::$BUILD_TYPE |
73 | 73 | shell: bash |
74 | 74 |
|
| 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 | + |
75 | 141 | # We build both master/1.9 and 1.8 style packages in a single job as it is simpler to keep all the custom |
76 | 142 | # code and workflow together. We need to run the dependent job after this as well. |
77 | 143 | call-build-linux-packages: |
|
0 commit comments