Skip to content

3.22.0

3.22.0 #70

Workflow file for this run

# .github/release.yml
name: Release on npm
on:
push:
branches:
- "master"
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: Checkout zod-deno
uses: actions/checkout@v2
with:
token: ${{ secrets.ZOD_BOT_TOKEN }}
repository: colinhacks/zod-deno
path: deno/lib
- name: Install dependencies
run: |
yarn install
- name: Build
run: |
yarn clean
yarn build
cp logo.svg deno/lib
cp README.md deno/lib
- 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 0
- name: Push to Deno
if: steps.publish.outputs.type != 'none'
working-directory: deno/lib
run: |
git config --global user.email "[email protected]"
git config --global user.name "Zod Bot"
git add . -f
git commit -m "Build from zod $GITHUB_SHA" --allow-empty
git push
- 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