Skip to content

Commit

Permalink
chore: add automation (ascorbic#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Feb 12, 2023
1 parent c1e65f6 commit 0576514
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Checkout
uses: actions/checkout@v3
- name: Test
run: deno test src/
- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- name: dnt
run: deno run -A ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
- name: npm publish
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd npm && npm publish
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deno test
on:
pull_request:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: Test
run: deno test src/
2 changes: 1 addition & 1 deletion scripts/build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ await build({
package: {
// package.json properties
name: "unpic",
version: Deno.args[0],
version: Deno.args[0]?.replace(/^v/, ""),
description: "Universal image CDN translator",
license: "MIT",
repository: {
Expand Down

0 comments on commit 0576514

Please sign in to comment.