diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..605d1eb --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,83 @@ +name: GitHub Release + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + + push: + branches: + - "*" + tags: + - "*" + + workflow_dispatch: + +env: + name: row + +defaults: + run: + shell: bash + +jobs: + release: + name: Build release tarball + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4.1.4 + with: + submodules: true + path: code + + - name: Determine filename-safe ref from GITHUB_REF_NAME + run: echo ref="$(echo "${GITHUB_REF_NAME}" | sed -e 's/\//-/g')" >> "$GITHUB_ENV" + working-directory: code + + - name: Write version change log + run: grep -m 2 -B 10000 "^## v*\d*\.\d*\.\d*" doc/src/release-notes.md | sed '$d' | tee "${GITHUB_WORKSPACE}/changelog.md" + working-directory: code + + - name: Copy source + run: cp -R code "${name}-${ref}" + + - name: Remove .git + run: rm -rf "${name}-${ref}/.git" && ls -laR "${name}-${ref}" + + - name: Tar/xz source + run: tar -cvJf "${name}-${ref}.tar.xz" "${name}-${ref}" + + - uses: actions/upload-artifact@v4.3.3 + with: + name: source + path: | + *.tar.* + changelog.md + + publish: + name: Publish [GitHub] + needs: [release] + runs-on: ubuntu-latest + + steps: + - name: Download artifacts + uses: actions/download-artifact@v4.1.7 + with: + merge-multiple: true + + - name: Create release + uses: softprops/action-gh-release@v2.0.5 + if: startsWith(github.ref, 'refs/tags/v') + with: + files: | + *.xz + body_path: changelog.md + make_latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/doc/src/release-notes.md b/doc/src/release-notes.md index 864a062..ec15972 100644 --- a/doc/src/release-notes.md +++ b/doc/src/release-notes.md @@ -3,3 +3,5 @@ ## 0.1.0 (not yet released) * Initial release. + +## 0.0.0