Skip to content

Commit

Permalink
ci: add release please
Browse files Browse the repository at this point in the history
  • Loading branch information
eoaksnes committed Jun 28, 2023
1 parent fbb436c commit b9e1ed0
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 11 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/create-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Create release-please PR"

on:
workflow_dispatch:
workflow_call:
outputs:
release_created:
description: "If true, a release PR has been merged"
value: ${{ jobs.release-please.outputs.release_created }}
tag_name:
description: "The release tag. Ex v1.4.0"
value: ${{ jobs.release-please.outputs.tag_name }}

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: release
changelog-types: >
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "feature", "section": "Features", "hidden": false},
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "revert", "section": "Reverts", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": false },
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
{ "type": "refactor", "section": "Code Refactoring", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false },
{ "type": "build", "section": "Build System", "hidden": false },
{ "type": "ci", "section": "Continuous Integration", "hidden": false }
]
# true for single package
- name: Echo release_created
run: echo "${{ steps.release.outputs.release_created }}"

# true for multiple packages
- name: Echo releases_created
run: echo "${{ steps.release.outputs.releases_created }}"

outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

28 changes: 17 additions & 11 deletions .github/workflows/on-main-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,31 @@ on:
push:
branches:
- main
- release

jobs:
tests:
uses: ./.github/workflows/tests.yaml

integration-tests:
uses: ./.github/workflows/integration-tests.yaml
#integration-tests:
# uses: ./.github/workflows/integration-tests.yaml

publish-integration-tests-report:
needs: integration-tests
if: ${{ ! cancelled() }}
uses: ./.github/workflows/publish-integration-tests-report.yaml
with:
dmss_version: ${{ needs.integration-tests.outputs.dmss_version }}
dm_cli_version: ${{ needs.integration-tests.outputs.dm_cli_version }}
job_version: ${{ needs.integration-tests.outputs.job_version }}
#publish-integration-tests-report:
# needs: integration-tests
# if: ${{ ! cancelled() }}
# uses: ./.github/workflows/publish-integration-tests-report.yaml
# with:
# dmss_version: ${{ needs.integration-tests.outputs.dmss_version }}
# dm_cli_version: ${{ needs.integration-tests.outputs.dm_cli_version }}
# job_version: ${{ needs.integration-tests.outputs.job_version }}

release-please:
needs: tests
uses: ./.github/workflows/create-release-pr.yaml

publish-packages:
needs: [tests]
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions packages/dm-core-plugins/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions packages/dm-core/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 18 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"release-type": "node",
"monorepo-tags": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"prerelease": true,
"separate-pull-requests": true,
"packages": {
"./packages/dm-core": {
"package-name": "@development-framework/dm-core",
"release-as": "0.1.0"
},
"./packages/dm-core-plugins": {
"package-name": "@development-framework/dm-core-plugins",
"release-as": "0.1.0"
}
}
}

0 comments on commit b9e1ed0

Please sign in to comment.