Skip to content

Commit e4de7a0

Browse files
committed
feat: update release workflow to enable caching, install dependencies, and create release
1 parent b623ec4 commit e4de7a0

1 file changed

Lines changed: 49 additions & 48 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ jobs:
3838
# run: |
3939
# npm run build
4040

41-
- name: Create Release
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45-
run: |
46-
npx auto shipit --dry-run > output.txt 2>&1
41+
# - name: Create Release
42+
# env:
43+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
# run: |
46+
# npx auto shipit --dry-run > output.txt 2>&1
4747

48-
# Print the raw output for inspection
49-
echo "Raw output:"
50-
cat output.txt
48+
# # Print the raw output for inspection
49+
# echo "Raw output:"
50+
# cat output.txt
5151

52-
# Print each line with line numbers and special characters visible
53-
echo "Output with special characters visible:"
54-
cat -A output.txt
52+
# # Print each line with line numbers and special characters visible
53+
# echo "Output with special characters visible:"
54+
# cat -A output.txt
5555

5656
- name: Check for version bump
5757
id: check
@@ -74,39 +74,40 @@ jobs:
7474
echo "Version bump needed"
7575
fi
7676
77-
# release:
78-
# runs-on: ubuntu-latest
79-
# if: ${{ !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') }}
80-
# steps:
81-
# - uses: actions/checkout@v2
82-
83-
# - name: Prepare repository
84-
# run: git fetch --unshallow --tags
85-
86-
# - name: Use Node.js 22.x
87-
# uses: actions/setup-node@v1
88-
# with:
89-
# node-version: 22.x
90-
91-
# - name: Cache node modules
92-
# uses: actions/cache@v4
93-
# with:
94-
# path: node_modules
95-
# key: npm-deps-${{ hashFiles('package-lock.json') }}
96-
# restore-keys: |
97-
# npm-deps-${{ hashFiles('package-lock.json') }}
98-
99-
# - name: Install Dependencies
100-
# run: |
101-
# npm ci
102-
103-
# - name: Build
104-
# run: |
105-
# npm run build
106-
107-
# - name: Create Release
108-
# env:
109-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110-
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
111-
# run: |
112-
# npx auto shipit
77+
release:
78+
needs: check-release
79+
if: needs.check-release.outputs.should_release == 'true'
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v2
83+
84+
- name: Prepare repository
85+
run: git fetch --unshallow --tags
86+
87+
- name: Use Node.js 22.x
88+
uses: actions/setup-node@v1
89+
with:
90+
node-version: 22.x
91+
92+
- name: Cache node modules
93+
uses: actions/cache@v4
94+
with:
95+
path: node_modules
96+
key: npm-deps-${{ hashFiles('package-lock.json') }}
97+
restore-keys: |
98+
npm-deps-${{ hashFiles('package-lock.json') }}
99+
100+
- name: Install Dependencies
101+
run: |
102+
npm ci
103+
104+
- name: Build
105+
run: |
106+
npm run build
107+
108+
- name: Create Release
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
112+
run: |
113+
npx auto shipit

0 commit comments

Comments
 (0)