-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1030 from colinhacks/ci
Implement release CI
- Loading branch information
Showing
10 changed files
with
241 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,95 @@ | ||
# .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 dependencies | ||
run: | | ||
yarn install | ||
- name: Build, lint, format | ||
run: | | ||
yarn clean | ||
yarn lint:fix | ||
yarn prettier:fix | ||
yarn build | ||
- name: Commit and push | ||
run: | | ||
git add . | ||
git config --global user.name 'ZodBot' | ||
git config --global user.email 'bot@zodlabs.com' | ||
git commit -am "chore: Format, lint, build Deno" | ||
git push | ||
- id: publish | ||
name: Publish to NPM | ||
uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
dry-run: false | ||
|
||
- name: Post-publish | ||
if: steps.publish.outputs.type != 'none' | ||
run: | | ||
echo "Published ${{ steps.publish.outputs.type }} version: ${{ steps.publish.outputs.version }}" | ||
- name: Publish skipped | ||
if: steps.publish.outputs.type == 'none' | ||
run: | | ||
echo "Version in package.json has not changed. Skipping." | ||
exit 1 | ||
- name: Configure changelog | ||
if: steps.publish.outputs.type != 'none' | ||
run: | | ||
echo '{"categories": [], "template": "## Commits:\n\n${{ '${{UNCATEGORIZED}}' }}", "pr_template": ${{ '"- ${{MERGE_SHA}} ${{TITLE}}"' }} }' > changelog_config.json | ||
cat changelog_config.json | ||
echo "last_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | ||
echo "curr_commit=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
- name: Generate changelog | ||
if: steps.publish.outputs.type != 'none' | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v2.9.0 | ||
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: false | ||
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
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
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
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
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
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
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
Oops, something went wrong.