Publish to deno.land/x #15
Workflow file for this run
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
name: Publish to deno.land/x | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to publish" | |
required: true | |
type: "string" | |
defaults: | |
run: | |
working-directory: . | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node_version: [18.14.2] | |
fail-fast: false | |
name: "Code quality checks on node-${{ matrix.node_version }}, ${{ matrix.os }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Set Node version to ${{ matrix.node_version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: "pnpm" | |
- name: Install Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- name: Install | |
run: pnpm install | |
- name: Build some packages | |
run: pnpm -r --filter=@hattip/graphql --filter=@hattip/compose build | |
- name: Checkout the Deno release repo | |
uses: actions/checkout@v2 | |
with: | |
repository: hattipjs/deno-release | |
path: _deno | |
- name: Build Deno sources | |
working-directory: deno-build | |
run: pnpm start | |
- name: Typecheck | |
working-directory: _deno | |
run: "deno check `find src -name '*.ts'`" | |
- name: "Commit changes if any" | |
working-directory: _deno | |
run: | | |
git config --global user.name "HatTip Deno Release Bot" | |
git config --global user.email "<>" | |
git add . | |
if [ git diff --quiet && git diff --staged --quiet ]; then | |
echo "No changes to commit" | |
exit 0 | |
fi | |
git commit -m "sync with hattipjs/hattip ${{ github.sha }}" | |
git tag v${{ github.event.inputs.version }}" | |
eval "$(ssh-agent -s)" | |
ssh-add - <<< "${{ secrets.GIT_PUSH_KEY }}" | |
ssh-add -l | |
git remote set-url origin [email protected]:hattipjs/deno-release.git | |
git push | |
git push --tags |