Skip to content

Commit a4975e5

Browse files
authored
feat: improve workflows (#4)
* feat: create pass-artifacts-to-next-jobs workflow * refactor: deploy name * ci: remove upload and download artifacts steps * ci: link release with build and lint jobs
1 parent 42a9261 commit a4975e5

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: pass-artifacts-to-next-jobs
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup
15+
uses: ./.github/actions/setup
16+
17+
- name: Build
18+
run: yarn build
19+
20+
- name: Upload Build Artifact
21+
uses: actions/upload-artifact@v4
22+
with:
23+
name: build-artifact
24+
path: build
25+
26+
run-build:
27+
name: Run build
28+
runs-on: ubuntu-latest
29+
needs: build
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Setup
36+
uses: ./.github/actions/setup
37+
38+
- name: Download Build Artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: build-artifact
42+
43+
- name: Run
44+
# This assumes that your build artifacts is an index.js
45+
run: node index.js

.github/workflows/deploy.yml renamed to .github/workflows/release-it-with-pr-only.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ jobs:
1717
- name: Build
1818
run: yarn build
1919

20-
- name: Upload Build Artifact
21-
uses: actions/upload-artifact@v4
22-
with:
23-
name: build-artifact
24-
path: build
25-
2620
lint:
2721
name: Lint
2822
runs-on: ubuntu-latest
@@ -40,7 +34,7 @@ jobs:
4034
release:
4135
name: Release
4236
runs-on: ubuntu-latest
43-
needs: build
37+
needs: [build, lint]
4438

4539
steps:
4640
- uses: actions/create-github-app-token@v1
@@ -58,11 +52,6 @@ jobs:
5852
- name: Setup
5953
uses: ./.github/actions/setup
6054

61-
- name: Download Build Artifact
62-
uses: actions/download-artifact@v4
63-
with:
64-
name: build-artifact
65-
6655
- name: Configure Git User
6756
run: |
6857
git config --global user.name "${GITHUB_ACTOR}"

0 commit comments

Comments
 (0)