]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | on: |
2 | release: | |
3 | types: [created] | |
4 | ||
5 | name: Handle Release | |
6 | ||
7 | jobs: | |
8 | build: | |
9 | name: Upload Release Asset | |
10 | runs-on: ubuntu-latest | |
11 | steps: | |
12 | - name: Checkout code | |
13 | uses: actions/checkout@v2 | |
14 | ||
15 | - name: Checkout submodules | |
16 | shell: bash | |
17 | run: | | |
18 | auth_header="$(git config --local --get http.https://github.com/.extraheader)" | |
19 | git submodule sync --recursive | |
20 | git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 | |
21 | ||
22 | - name: Create tarball including submodules | |
23 | shell: bash | |
24 | env: | |
25 | PREFIX: prometheus-cpp-with-submodules | |
26 | run: | | |
27 | git archive --prefix "${PREFIX}/" -o "${PREFIX}.tar" HEAD | |
28 | git submodule foreach --recursive "git archive --prefix=${PREFIX}/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/${PREFIX}.tar \$sha1.tar && rm \$sha1.tar" | |
29 | gzip "${PREFIX}.tar" | |
30 | ||
31 | # using the official actions/upload-release-asset action would be preferred but is blocked by | |
32 | # https://github.com/actions/upload-release-asset/pull/41 | |
33 | - name: Upload the artifacts | |
34 | uses: skx/github-action-publish-binaries@75ce5546020fc1848da842f40240f9fa03e7a3a8 # release-0.14 | |
35 | env: | |
36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
37 | with: | |
38 | args: prometheus-cpp-with-submodules.tar.gz |