Skip to content

Commit 89b7c4c

Browse files
committed
Merge branch 'release_action' of https://github.com/rofl0r/htop into rofl0r-release_action
2 parents 78aefc2 + 42c0493 commit 89b7c4c

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/build_release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Source Release
2+
3+
# Trigger whenever a release is created
4+
on:
5+
release:
6+
types:
7+
- created
8+
9+
jobs:
10+
build:
11+
name: build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
with:
16+
submodules: true
17+
18+
- name: archive
19+
id: archive
20+
run: |
21+
VERSION=${{ github.event.release.tag_name }}
22+
PKGNAME="htop-$VERSION"
23+
SHASUM=$PKGNAME.tar.xz.sha256
24+
autoreconf -i
25+
mkdir -p /tmp/$PKGNAME
26+
mv * /tmp/$PKGNAME
27+
mv /tmp/$PKGNAME .
28+
TARBALL=$PKGNAME.tar.xz
29+
tar cJf $TARBALL $PKGNAME
30+
sha256sum $TARBALL > $SHASUM
31+
echo "::set-output name=tarball::$TARBALL"
32+
echo "::set-output name=shasum::$SHASUM"
33+
- name: upload tarball
34+
uses: actions/upload-release-asset@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
upload_url: ${{ github.event.release.upload_url }}
39+
asset_path: ./${{ steps.archive.outputs.tarball }}
40+
asset_name: ${{ steps.archive.outputs.tarball }}
41+
asset_content_type: application/gzip
42+
43+
- name: upload shasum
44+
uses: actions/upload-release-asset@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
upload_url: ${{ github.event.release.upload_url }}
49+
asset_path: ./${{ steps.archive.outputs.shasum }}
50+
asset_name: ${{ steps.archive.outputs.shasum }}
51+
asset_content_type: text/plain

0 commit comments

Comments
 (0)