-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Colin McDonnell
committed
Mar 18, 2022
1 parent
38cc89d
commit 9004904
Showing
2 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# .github/release.yml | ||
|
||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "ci" | ||
paths: | ||
- package.json | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install deps and build | ||
run: | | ||
yarn install | ||
yarn build | ||
- id: publish | ||
name: Publish to NPM | ||
uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
dry-run: true | ||
|
||
- name: If Publish | ||
if: steps.publish.outputs.type != 'none' | ||
run: | | ||
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}" | ||
- name: If Version Unchanged | ||
if: steps.publish.outputs.type == 'none' | ||
run: | | ||
echo "Version in package.json has not changed. Skipping." | ||
- name: Write Changelog Config | ||
run: | | ||
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json | ||
cat changelog_config.json | ||
- name: Changelog Vars | ||
run: | | ||
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
- name: Build Changelog | ||
id: github_release | ||
uses: mikepenz/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
fromTag: "${{ env.last_tag }}" | ||
toTag: ${{ github.ref }} | ||
commitMode: true | ||
configuration: changelog_config.json | ||
|
||
- name: Create Release | ||
if: steps.publish.outputs.type != 'none' | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.publish.outputs.version }} | ||
release_name: v${{ steps.publish.outputs.version }} | ||
commitish: ${{ github.ref }} | ||
body: ${{steps.github_release.outputs.changelog}} | ||
draft: true | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters