summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build_release.yml
blob: 2bdf443d28ea711d0e9ad60aac84ee888810b4e6 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Build Source Release

# Trigger whenever a release is created
on:
  release:
    types:
      - created

jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        submodules: true

    - name: archive
      id: archive
      run: |
        VERSION=${{ github.event.release.tag_name }}
        PKGNAME="htop-$VERSION"
        SHASUM=$PKGNAME.tar.xz.sha256
        autoreconf -i
        mkdir -p /tmp/$PKGNAME
        mv * /tmp/$PKGNAME
        mv /tmp/$PKGNAME .
        TARBALL=$PKGNAME.tar.xz
        tar cJf $TARBALL $PKGNAME
        sha256sum $TARBALL > $SHASUM
        echo "::set-output name=tarball::$TARBALL"
        echo "::set-output name=shasum::$SHASUM"
    - name: upload tarball
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ./${{ steps.archive.outputs.tarball }}
        asset_name: ${{ steps.archive.outputs.tarball }}
        asset_content_type: application/gzip

    - name: upload shasum
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ./${{ steps.archive.outputs.shasum }}
        asset_name: ${{ steps.archive.outputs.shasum }}
        asset_content_type: text/plain