Skip to content

Commit

Permalink
feat: demo cd pipeline, release pelase configs
Browse files Browse the repository at this point in the history
  • Loading branch information
fibble committed Dec 20, 2024
1 parent 5392c06 commit 0288547
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions prerelease-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG-PRERELEASE.md",
"release-type": "simple",
"draft": false,
"prerelease": true
}
}
}
10 changes: 10 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "simple",
"draft": false,
"prerelease": false
}
}
}

0 comments on commit 0288547

Please sign in to comment.