forked from hunter-packages/prometheus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.13 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
on:
release:
types: [created]
name: Handle Release
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: true
- name: Create tarball including submodules
shell: bash
env:
PREFIX: prometheus-cpp-with-submodules
run: |
git archive --prefix "${PREFIX}/" -o "${PREFIX}.tar" HEAD
git submodule foreach --recursive "git archive --prefix=${PREFIX}/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/${PREFIX}.tar \$sha1.tar && rm \$sha1.tar"
gzip "${PREFIX}.tar"
# using the official actions/upload-release-asset action would be preferred but is blocked by
# https://github.com/actions/upload-release-asset/pull/41
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@75ce5546020fc1848da842f40240f9fa03e7a3a8 # release-0.14
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: prometheus-cpp-with-submodules.tar.gz