diff --git a/.github/.release-manifest.json b/.github/.release-manifest.json new file mode 100644 index 0000000..466df71 --- /dev/null +++ b/.github/.release-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/.github/release-config.json b/.github/release-config.json new file mode 100644 index 0000000..e9abfd8 --- /dev/null +++ b/.github/release-config.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "changelog-sections": [ + { + "type": "feat", + "section": "Features", + "hidden": false + }, + { + "type": "fix", + "section": "Bug Fixes", + "hidden": false + }, + { + "type": "perf", + "section": "Performance", + "hidden": false + }, + { + "type": "refactor", + "section": "Refactoring", + "hidden": false + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "chore", + "section": "Chores", + "hidden": false + } + ], + "packages": { + ".": { + "release-type": "rust", + "package-name": "macaw" + } + } +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3e0ead0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + releases_created: ${{ steps.release.outputs.releases_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - name: Run release-please + id: release + uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config-file: .github/release-config.json + manifest-file: .github/.release-manifest.json + + binary-build: + runs-on: ubuntu-latest + needs: + - release-please + if: needs.release-please.outputs.releases_created == 'true' + steps: + - name: Check out main + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build Linux x86_64 binary + run: cargo build --release --locked --bin macaw + + - name: Package binary + run: tar -C target/release -czf macaw-x86_64-unknown-linux-gnu.tar.gz macaw + + - name: Upload binary to GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG_NAME: ${{ needs.release-please.outputs.tag_name }} + run: gh release upload "$TAG_NAME" macaw-x86_64-unknown-linux-gnu.tar.gz