diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..1dc7dd0 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,14 @@ +changelog: + exclude: + authors: + - dependabot + categories: + - title: Added + labels: + - enhancement + - title: Fixed + labels: + - bug + - title: Changed + labels: + - "*" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d6b6bd3 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,60 @@ +name: GitHub Release + +on: + pull_request: + + push: + branches: + - "trunk" + tags: + - "v*" + + workflow_dispatch: + +permissions: + contents: write + +defaults: + run: + shell: bash + +jobs: + release: + name: Publish [GitHub] + runs-on: ubuntu-latest + + steps: + - name: Determine version number + id: version + run: | + TAG=${{ github.ref_name }} + # Remove v from start of tag name + VERSION=${TAG#v} + # Replace / with - in merge names + VERSION=${VERSION//\//-} + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "name=${{ github.event.repository.name }}-${VERSION}" >> "$GITHUB_OUTPUT" + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + path: ${{ steps.version.outputs.name }} + + - name: Remove .git + run: | + rm -rf ${{ steps.version.outputs.name }}/.git + ls -laR ${{ steps.version.outputs.name }} + + - name: Tar source + run: tar --zstd -cvf ${{ steps.version.outputs.name }}.tar.zst ${{ steps.version.outputs.name }} + + - name: Create release + uses: softprops/action-gh-release@v0.1.15 + if: startsWith(github.ref, 'refs/tags/v') + with: + files: "*.tar.zst" + name: ${{ steps.version.outputs.version }} + generate_release_notes: True + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}