Skip to content

Commit

Permalink
Update GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ccremer committed Aug 5, 2023
1 parent e9d961f commit 6bef307
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"pr_template": "- ${{TITLE}} by @${{AUTHOR}} (#${{NUMBER}})",
"label_extractor": [
{
"pattern": "release ([a-z:-]+)",
"target": "$1",
"method": "match"
}
],
"categories": [
{
"title": "## 🚀 Features",
"key": "features",
"labels": [
"minor"
]
},
{
"title": "## 🛠️ Minor Changes",
"labels": [
"internal"
]
},
{
"title": "## 🔎 Breaking Changes",
"labels": [
"major"
]
},
{
"title": "## 🐛 Fixes",
"labels": [
"patch"
]
},
{
"title": "## 📄 Documentation",
"labels": [
"documentation"
]
},
{
"title": "## 🔗 Dependency Updates",
"labels": [
"dependencies"
]
}
],
"template": "${{CHANGELOG}}"
}
40 changes: 38 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,47 @@ jobs:
run:
echo "//registry.npmjs.org/:_authToken=${{ secrets. NPM_TOKEN }}" >> ./.npmrc

- name: Create Release
- name: Build
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install
npm run build
npm run release
- name: Determine Semver
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
echo "PREVIOUS_VERSION=$(yq e '.version' -o yaml lerna.json)" >> $GITHUB_ENV
echo "SEMVER_TYPE=$(npx auto version)" >> $GITHUB_ENV
- name: Publish Packages
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "type=${{ env.SEMVER_TYPE }}, prev=${{ env.PREVIOUS_VERSION }}"
npx lerna version ${{ env.SEMVER_TYPE }} --force-publish --ignore-changes --preid rc
npx lerna publish from-git
echo "NEXT_VERSION=$(yq e '.version' -o yaml lerna.json)" >> $GITHUB_ENV
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: ".github/changelog-configuration.json"
outputFile: .github/release-notes.md
# PreReleases still get a changelog, but the next full release gets a diff since the last full release,
# combining possible changelogs of all previous PreReleases in between.
# PreReleases show a partial changelog since last PreRelease.
ignorePreReleases: "${{ !contains(env.NEXT_VERSION, '-rc') }}"
fromTag: ${{ env.PREVIOUS_VERSION }}
toTag: ${{ env.NEXT_VERSION }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Create Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create ${{ env.NEXT_VERSION }} --notes-file .github/release-notes.md --prerelease=${{ contains(env.NEXT_VERSION, '-rc') }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ node_modules/
# generated output
dist
/angular.json
.github/release-notes.md

# test output
playwright-report
Expand Down

0 comments on commit 6bef307

Please sign in to comment.