1
1
name : Create Releases
2
2
on :
3
3
workflow_dispatch :
4
-
4
+ inputs :
5
+ projects :
6
+ description : ' Package Bump'
7
+ required : true
8
+ default : ' json-api-nestjs,json-api-nestjs-sdk,nestjs-json-rpc,nestjs-json-rpc-sdk'
9
+ first-release :
10
+ description : ' Is first release?'
11
+ required : false
12
+ type : boolean
13
+ default : false
5
14
jobs :
6
- build-and-test :
7
- name : " Build and test"
8
- runs-on : ubuntu-latest
9
- permissions :
10
- contents : " read"
11
- actions : " read"
12
- steps :
13
- - uses : actions/checkout@v4
14
- with :
15
- fetch-depth : 0
16
- - name : Npm install
17
- uses : ./.github/actions
18
- - name : Get git hash
19
- run : |
20
- COMMIT=$(git show-ref --tags --hash | tail -n 1)
21
- echo "NX_BASE=$(echo ${COMMIT})" >> $GITHUB_ENV
22
- - name : Set GIST_SECRET to env
23
- run : |
24
- echo "GIST_SECRET=${{ secrets.GIST_SECRET }}" >> $GITHUB_ENV
25
- echo "GIST_ID=${{ secrets.GIST_ID }}" >> $GITHUB_ENV
26
- - name : Restore cached .nx
27
- id : cache-nx-restore
28
- uses : actions/cache/restore@v4
29
- with :
30
- path : |
31
- .nx
32
- key : ${{ runner.os }}-nx-master
33
- - name : Test
34
- env :
35
- NX_REJECT_UNKNOWN_LOCAL_CACHE : 0
36
- run : npx nx affected -t test --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
37
- - name : Build
38
- env :
39
- NX_REJECT_UNKNOWN_LOCAL_CACHE : 0
40
- run : npx nx affected -t build --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
41
- - name : Upload test coverage badge
42
- run : npx nx affected -t upload-badge --exclude='json-api-front,json-api-server,shared-utils,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
43
- - name : Save cached .nx
44
- id : cache-dependencies-save
45
- uses : actions/cache/save@v4
46
- with :
47
- path : |
48
- .nx
49
- key : ${{ steps.cache-nx-restore.outputs.cache-primary-key }}
50
- run-e2e-test :
51
- runs-on : ubuntu-latest
52
- name : Try run e2e test
53
- needs :
54
- - build-and-test
55
- services :
56
- # Label used to access the service container
57
- postgres :
58
- # Docker Hub image
59
- image : postgres
60
- # Provide the password for postgres
61
- env :
62
- POSTGRES_PASSWORD : postgres
63
- POSTGRES_DB : json-api-db
64
- # Set health checks to wait until postgres has started
65
- options : >-
66
- --health-cmd pg_isready
67
- --health-interval 10s
68
- --health-timeout 5s
69
- --health-retries 5
70
- ports :
71
- # Maps tcp port 5432 on service container to the host
72
- - 5432:5432
73
- steps :
74
- - uses : actions/checkout@v4
75
- with :
76
- fetch-depth : 0
77
- - name : Npm install
78
- uses : ./.github/actions
79
- - name : Restore cached .nx
80
- id : cache-nx-restore
81
- uses : actions/cache/restore@v4
82
- with :
83
- path : |
84
- .nx
85
- key : ${{ runner.os }}-nx-master
86
- - run : git branch --track main origin/master
87
- - run : npm run typeorm migration:run
88
- - run : npm run seed:run
89
- - run : npx nx affected -t e2e --parallel=1
90
- - name : Save cached .nx
91
- id : cache-dependencies-save
92
- uses : actions/cache/save@v4
93
- with :
94
- path : |
95
- .nx
96
- key : ${{ steps.cache-nx-restore.outputs.cache-primary-key }}
15
+ # build-and-test:
16
+ # name: "Build and test"
17
+ # runs-on: ubuntu-latest
18
+ # permissions:
19
+ # contents: "read"
20
+ # actions: "read"
21
+ # steps:
22
+ # - uses: actions/checkout@v4
23
+ # with:
24
+ # fetch-depth: 0
25
+ # - name: Npm install
26
+ # uses: ./.github/actions
27
+ # - name: Get git hash
28
+ # run: |
29
+ # COMMIT=$(git show-ref --tags --hash | tail -n 1)
30
+ # echo "NX_BASE=$(echo ${COMMIT})" >> $GITHUB_ENV
31
+ # - name: Set GIST_SECRET to env
32
+ # run: |
33
+ # echo "GIST_SECRET=${{ secrets.GIST_SECRET }}" >> $GITHUB_ENV
34
+ # echo "GIST_ID=${{ secrets.GIST_ID }}" >> $GITHUB_ENV
35
+ # - name: Restore cached .nx
36
+ # id: cache-nx-restore
37
+ # uses: actions/cache/restore@v4
38
+ # with:
39
+ # path: |
40
+ # .nx
41
+ # key: ${{ runner.os }}-nx-master
42
+ # - name: Test
43
+ # env:
44
+ # NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
45
+ # run: npx nx affected -t test --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
46
+ # - name: Build
47
+ # env:
48
+ # NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
49
+ # run: npx nx affected -t build --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
50
+ # - name: Upload test coverage badge
51
+ # run: npx nx affected -t upload-badge --exclude='json-api-front,json-api-server,shared-utils,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source,type-for-rpc'
52
+ # - name: Save cached .nx
53
+ # id: cache-dependencies-save
54
+ # uses: actions/cache/save@v4
55
+ # with:
56
+ # path: |
57
+ # .nx
58
+ # key: ${{ steps.cache-nx-restore.outputs.cache-primary-key }}
59
+ # run-e2e-test:
60
+ # runs-on: ubuntu-latest
61
+ # name: Try run e2e test
62
+ # needs:
63
+ # - build-and-test
64
+ # services:
65
+ # # Label used to access the service container
66
+ # postgres:
67
+ # # Docker Hub image
68
+ # image: postgres
69
+ # # Provide the password for postgres
70
+ # env:
71
+ # POSTGRES_PASSWORD: postgres
72
+ # POSTGRES_DB: json-api-db
73
+ # # Set health checks to wait until postgres has started
74
+ # options: >-
75
+ # --health-cmd pg_isready
76
+ # --health-interval 10s
77
+ # --health-timeout 5s
78
+ # --health-retries 5
79
+ # ports:
80
+ # # Maps tcp port 5432 on service container to the host
81
+ # - 5432:5432
82
+ # steps:
83
+ # - uses: actions/checkout@v4
84
+ # with:
85
+ # fetch-depth: 0
86
+ # - name: Npm install
87
+ # uses: ./.github/actions
88
+ # - name: Restore cached .nx
89
+ # id: cache-nx-restore
90
+ # uses: actions/cache/restore@v4
91
+ # with:
92
+ # path: |
93
+ # .nx
94
+ # key: ${{ runner.os }}-nx-master
95
+ # - run: git branch --track main origin/master
96
+ # - run: npm run typeorm migration:run
97
+ # - run: npm run seed:run
98
+ # - run: npx nx affected -t e2e --parallel=1
99
+ # - name: Save cached .nx
100
+ # id: cache-dependencies-save
101
+ # uses: actions/cache/save@v4
102
+ # with:
103
+ # path: |
104
+ # .nx
105
+ # key: ${{ steps.cache-nx-restore.outputs.cache-primary-key }}
97
106
bump-version :
98
107
name : " Bump version"
99
- needs :
100
- - run-e2e-test
108
+ # needs:
109
+ # - run-e2e-test
101
110
runs-on : ubuntu-latest
102
111
permissions :
103
112
contents : " write"
@@ -116,7 +125,7 @@ jobs:
116
125
run : |
117
126
git config --global user.email "actions@github.com"
118
127
git config --global user.name "GitHub Actions"
119
- npx nx release --skip-publish --dry-run
128
+ npx nx release --skip-publish --projects=${{ github.event.inputs.projects }} -- dry-run
120
129
shell : bash
121
130
env :
122
131
NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
0 commit comments