From 0288547c493f34ec305b05539e3292eea9a6bc89 Mon Sep 17 00:00:00 2001 From: Andrew Newton Date: Fri, 20 Dec 2024 14:47:50 +0000 Subject: [PATCH] feat: demo cd pipeline, release pelase configs --- .github/workflows/cd.yaml | 41 ++++++++++++++++++++++++++++++++++++++ prerelease-config.json | 10 ++++++++++ release-please-config.json | 10 ++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/cd.yaml create mode 100644 prerelease-config.json create mode 100644 release-please-config.json diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..74ef397 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,41 @@ +name: Release Please PreRelease Test + +on: + push: + branches: + - main + - prerelease + +jobs: + release-please: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + outputs: + tag_name: ${{ steps.release.outputs.tag_name }} + release_created: ${{ steps.release.outputs.release_created }} + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Configure Release-Please for Branch + run: | + if [[ "${{ github.ref_name }}" == "prerelease" ]]; then + echo "Configuring for pre-releases..." + cp prerelease-config.json release-please-config.json + fi + + - name: Run Release-Please + id: release + uses: googleapis/release-please-action@v4 + with: + target-branch: ${{ github.ref_name }} + + - name: Cleanup + if: always() + run: | + if [[ "${{ github.ref_name }}" == "prerelease" ]]; then + git checkout -- release-please-config.json || true + fi \ No newline at end of file diff --git a/prerelease-config.json b/prerelease-config.json new file mode 100644 index 0000000..6e353db --- /dev/null +++ b/prerelease-config.json @@ -0,0 +1,10 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG-PRERELEASE.md", + "release-type": "simple", + "draft": false, + "prerelease": true + } + } +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..9b46c74 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "release-type": "simple", + "draft": false, + "prerelease": false + } + } +} \ No newline at end of file