build_release.yml 1.4 KB

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