another try 0.10.5 #7
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
# .github/release.yml | |
name: Release on npm | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- packages/sure/package.json | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.6.9 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.16.1 | |
cache: 'pnpm' | |
- run: pnpm install | |
- run: pnpm -F @robolex/sure run build | |
- run: pnpm -F @robolex/sure run tsc:ci | |
- run: pnpm -F @robolex/sure run test:ci | |
- id: publish | |
name: Publish to NPM | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: 'packages/sure' | |
- 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 0 | |
- 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/[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: false | |
prerelease: false | |
# - name: Create Deno release | |
# if: steps.publish.outputs.type != 'none' | |
# id: create_deno_release | |
# uses: actions/create-release@latest | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.ZOD_BOT_TOKEN }} | |
# with: | |
# tag_name: v${{ steps.publish.outputs.version }} | |
# release_name: v${{ steps.publish.outputs.version }} | |
# commitish: refs/heads/main | |
# body: ${{steps.github_release.outputs.changelog}} | |
# draft: false | |
# prerelease: false | |
# owner: colinhacks | |
# repo: zod-deno |