Skip to content

Commit d112b7f

Browse files
authored
Merge pull request #28 from hexlet-components/frontend-publish
2 parents 70adbe1 + 722688b commit d112b7f

File tree

9 files changed

+362
-282
lines changed

9 files changed

+362
-282
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
- uses: actions/setup-java@v3
1414
with:
1515
distribution: 'temurin'

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: On Release Frontend
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
defaults:
11+
run:
12+
working-directory: ./frontend
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
- name: Install
20+
run: make install
21+
- name: Run linter
22+
run: make lint
23+
- name: Run tests
24+
run: make test
25+
- name: Build dist
26+
run: make build
27+
- name: Publish
28+
run: make publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
setup:
2-
cd frontend && npm install
2+
npm install
33
./gradlew wrapper --gradle-version 8.3
44
./gradlew build
55

66
frontend:
7-
cd frontend && npm run dev
7+
npx start-frontend
88

99
backend:
1010
./gradlew bootRun --args='--spring.profiles.active=dev'
@@ -40,7 +40,7 @@ test:
4040
# ./gradlew jacocoTestReport
4141

4242
update-js-deps:
43-
cd frontend && npx ncu -u
43+
npx ncu -u
4444

4545
check-java-deps:
4646
./gradlew dependencyUpdates -Drevision=release

frontend/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
start:
2+
npm start
3+
4+
install:
5+
npm i
6+
7+
build:
8+
npm run build
9+
10+
publish:
11+
npm publish --access=public
12+
13+
lint:
14+
npx eslint .
15+
16+
# TODO: добавить тесты
17+
test:
18+
echo no tests

0 commit comments

Comments
 (0)