Skip to content

Commit 7a3bfd3

Browse files
armandobelardodsinghvi
authored andcommitted
chore: consolidate ruby publish to new format (#2796)
publish ruby generators through a VERSION file
1 parent 4468b34 commit 7a3bfd3

File tree

4 files changed

+96
-46
lines changed

4 files changed

+96
-46
lines changed

.github/workflows/generators-publish.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/publish-generator.yml

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- "generators/openapi/VERSION"
9-
- 'generators/python/sdk/VERSION'
10-
- 'generators/python/fastapi/VERSION'
11-
- 'generators/python/pydantic/VERSION'
12-
- 'generators/postman/VERSION'
7+
paths:
8+
- "generators/openapi/VERSION"
9+
- 'generators/python/sdk/VERSION'
10+
- 'generators/python/fastapi/VERSION'
11+
- 'generators/python/pydantic/VERSION'
12+
- 'generators/postman/VERSION'
13+
- 'generators/ruby/model/VERSION'
14+
- 'generators/ruby/sdk/VERSION'
1315

1416
jobs:
1517
versions-changed:
@@ -20,6 +22,8 @@ jobs:
2022
fastapi: ${{ steps.filter.outputs.fastapi }}
2123
pydantic: ${{ steps.filter.outputs.pydantic }}
2224
postman: ${{ steps.filter.outputs.postman }}
25+
ruby-model: ${{ steps.filter.outputs.ruby-model }}
26+
ruby-sdk: ${{ steps.filter.outputs.ruby-sdk }}
2327
steps:
2428
- uses: dorny/paths-filter@v2
2529
id: filter
@@ -30,6 +34,8 @@ jobs:
3034
fastapi: 'generators/python/fastapi/VERSION'
3135
pydantic: 'generators/python/pydantic/VERSION'
3236
postman: 'generators/postman/VERSION'
37+
ruby-model: 'generators/ruby/model/VERSION'
38+
ruby-sdk: 'generators/ruby/sdk/VERSION'
3339
3440
pydantic-model:
3541
runs-on: ubuntu-latest
@@ -235,3 +241,85 @@ jobs:
235241
platforms: linux/amd64,linux/arm64
236242
push: true
237243
tags: fernapi/fern-postman:${{env.VERSION}}
244+
245+
ruby-model:
246+
runs-on: ubuntu-latest
247+
needs: versions-changed
248+
if: ${{ needs.changes.outputs.ruby-model == 'true'}}
249+
steps:
250+
- name: Checkout repo
251+
uses: actions/checkout@v4
252+
253+
- uses: actions/setup-node@v3
254+
with:
255+
node-version: 18
256+
cache: "yarn"
257+
258+
- name: Log in to Docker Hub
259+
uses: docker/login-action@v3
260+
with:
261+
username: fernapi
262+
password: ${{ secrets.FERN_API_DOCKERHUB_PASSWORD }}
263+
264+
- name: Build CLI
265+
working-directory: ./generators/ruby/model
266+
run: yarn dist:cli
267+
268+
- name: Print Version
269+
run: |
270+
projectVersion=$(cat generators/ruby/model/VERSION)
271+
echo $projectVersion
272+
echo "VERSION=$projectVersion" >> $GITHUB_ENV
273+
274+
- name: Set up Docker Buildx
275+
uses: docker/setup-buildx-action@v1
276+
277+
- name: Build and push Docker image
278+
uses: docker/build-push-action@v2
279+
with:
280+
context: .
281+
file: ./generators/ruby/model/Dockerfile
282+
platforms: linux/amd64,linux/arm64
283+
push: true
284+
tags: fernapi/fern-ruby-model:${{env.VERSION}}
285+
286+
ruby-sdk:
287+
runs-on: ubuntu-latest
288+
needs: versions-changed
289+
if: ${{ needs.changes.outputs.ruby-sdk == 'true'}}
290+
steps:
291+
- name: Checkout repo
292+
uses: actions/checkout@v4
293+
294+
- uses: actions/setup-node@v3
295+
with:
296+
node-version: 18
297+
cache: "yarn"
298+
299+
- name: Log in to Docker Hub
300+
uses: docker/login-action@v3
301+
with:
302+
username: fernapi
303+
password: ${{ secrets.FERN_API_DOCKERHUB_PASSWORD }}
304+
305+
- name: Build CLI
306+
working-directory: ./generators/ruby/sdk
307+
run: yarn dist:cli
308+
309+
- name: Print Version
310+
run: |
311+
projectVersion=$(cat generators/ruby/sdk/VERSION)
312+
echo $projectVersion
313+
echo "VERSION=$projectVersion" >> $GITHUB_ENV
314+
315+
- name: Set up Docker Buildx
316+
uses: docker/setup-buildx-action@v1
317+
318+
- name: Build and push Docker image
319+
uses: docker/build-push-action@v2
320+
with:
321+
context: .
322+
file: ./generators/ruby/sdk/Dockerfile
323+
platforms: linux/amd64,linux/arm64
324+
push: true
325+
tags: fernapi/fern-ruby-sdk:${{env.VERSION}}

generators/ruby/model/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.6

generators/ruby/sdk/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.0

0 commit comments

Comments
 (0)