-
Notifications
You must be signed in to change notification settings - Fork 357
27 lines (24 loc) · 847 Bytes
/
Copy pathrelease.yml
File metadata and controls
27 lines (24 loc) · 847 Bytes
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
on:
release:
types: [created]
name: Handle Release
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-slim
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
persist-credentials: false
submodules: true
- name: Create tarball including submodules
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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"
gh release upload ${{ github.event.release.tag_name }} "${PREFIX}.tar.gz"