kuboon_daily-nav/.github/workflows/release.yml
2026-04-04 01:49:30 +00:00

64 lines
1.7 KiB
YAML

name: Tag
on:
push:
branches: ["main"]
tags: ["pre"]
jobs:
test:
uses: ./.github/workflows/test.yml
check_tag:
runs-on: ubuntu-latest
outputs:
TAG_NAME: ${{ steps.get_tag.outputs.TAG_NAME }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- id: get_tag
name: Get Local Tag Name
run: |
TAG_NAME=$(jq -r .version manifest.json)
if git fetch --depth 1 origin tag $TAG_NAME; then
echo "::notice::$TAG_NAME already released. skip publishing."
exit 0
fi
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
release:
needs: [test, check_tag]
if: needs.check_tag.outputs.TAG_NAME != ''
permissions:
contents: write
env:
TAG_NAME: ${{ needs.check_tag.outputs.TAG_NAME }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
cache: true
- name: bump version
run: deno task version-bump
- name: Create Tag
run: |
git config user.email "o@kbn.one"
git config user.name "github action"
git tag $TAG_NAME
git push origin $TAG_NAME
- run: deno task build
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
REF_NAME="${{ github.ref_name }}"
PRE_RELEASE_FLAG=""
if [[ "$REF_NAME" == *pre* ]]; then
PRE_RELEASE_FLAG="--prerelease"
fi
gh release create "$TAG_NAME" manifest.json versions.json main.js styles.css --generate-notes $PRE_RELEASE_FLAG