-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (36 loc) · 922 Bytes
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Release
on:
- push
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
strategy:
matrix:
node-version:
- "20"
steps:
- uses: actions/checkout@v4
- run: npm i
- run: npm t
- run: npm run format
- name: commit auto fixes
env:
USERNAME: ${{ github.actor }}
BRANCH: ${{ github.ref_name }}
REPO: ${{ github.repository }}
run: |
if [ "$(git diff --quiet && echo 0 || echo $?)" -gt 0 ]; then
git commit -am "😎 Autofix"
git push origin $BRANCH
exit 1
fi
- name: Build and Publish
if: github.ref == 'refs/heads/main'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npx @lets/publish