Skip to content

Commit

Permalink
Add workflow to publish graphql client to central on release
Browse files Browse the repository at this point in the history
- Add functionality to automatically update version numbers
  • Loading branch information
rukmal committed Sep 27, 2022
1 parent 954ee5d commit 4b5e505
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 710 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
args: test
env:
WORKING_DIR: api
generate-graphql-client-job:
generate-graphql-client:
name: Generate GraphQL Client
needs: api-test
runs-on: ubuntu-22.04
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@ on:
- "published"

jobs:
update-version:
runs-on: ubuntu-22.04
strategy:
matrix:
version_file: ["api/Ballerina.toml", "cleint/Ballerina.toml"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set output
id: vars
# See: https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=tag::${GITHUB_REF#refs/v*/}
- name: Update versions in package files
uses: ciiiii/toml-editor@1.0.0
with:
file: ${{ matrix.version_file }}
key: "package.version"
value: ${{ steps.vars.outputs.tag }}
update-staging-db:
name: Update Azure staging database
needs: update-version
runs-on: ubuntu-22.04
environment: Staging
permissions:
Expand All @@ -26,3 +45,22 @@ jobs:
USER: ${{ secrets.DB_USER }}
PASSWORD: ${{ secrets.DB_PASSWORD }}
DATABASE: ${{ secrets.DB_DATABASE }}
push-api-client:
name: Publish GraphQL API Client
needs: update-staging-db
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build distribution archive of client package
uses: ballerina-platform/ballerina-action@394eb82cc07e020948fee8d1474143ae393147f4
with:
args: pack
env:
WORKING_DIR: client
- name: Push to central
uses: ballerina-platform/ballerina-action@394eb82cc07e020948fee8d1474143ae393147f4
with:
args: push
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target
Dependencies.toml
Loading

0 comments on commit 4b5e505

Please sign in to comment.