Skip to content

Commit

Permalink
first pass publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeskydev committed Nov 4, 2024
1 parent 2b8a8f5 commit a2c7b72
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on:
workflow_dispatch:

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main

- name: Calculate Tag
id: tag
run: |
TAG=$(jq -r '.version' package.json)
echo "TAG=$TAG" >> $GITHUB_ENV
if git rev-parse $TAG >/dev/null 2>&1; then
echo "TAG_EXISTS=true" >> $GITHUB_ENV
else
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
- name: Samples to Samples~
run: |
if [[ -d "Samples" ]]; then
git mv Samples Samples~
rm -f Samples.meta
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "fix: Samples => Samples~"
git push -u origin main
fi
- name: Create Release
if: env.TAG_EXISTS == 'false'
run: |
git tag ${{ env.TAG }} main
git push origin --tags

0 comments on commit a2c7b72

Please sign in to comment.