refactor(server): JS can import and run with one line (#52) #2
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: π Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- deno.json | |
permissions: | |
contents: write | |
id-token: write | |
jobs: | |
Release: | |
runs-on: Ubuntu-Latest | |
steps: | |
- name: π Checkout Repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: π¦ Get the Package Version | |
uses: notiz-dev/github-action-json-property@a5a9c668b16513c737c3e1f8956772c99c73f6e8 # v0.2.0 | |
id: version | |
with: | |
path: deno.json | |
prop_path: version | |
- name: π Detect the Version has Changed | |
id: version-has-changed | |
run: | | |
tag="$(git tag -l | sort -V | tail -n 1)" | |
if [[ "$tag" == "v${{ steps.version.outputs.prop }}" ]]; then | |
echo "stop=true" | tee -a "$GITHUB_OUTPUT" | |
fi | |
- name: π Rrelease a New Version | |
if: ${{ steps.version-has-changed.outputs.stop != 'true' }} | |
run: gh release create "v${{ steps.version.outputs.prop }}" --generate-notes | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: β¬οΈ Publish to JSR | |
if: ${{ steps.version-has-changed.outputs.stop != 'true' }} | |
run: npx jsr publish |