-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to publish graphql client to central on release
- Add functionality to automatically update version numbers - Fix bug in db that was breaking idempotent deployment. Filed #18
- Loading branch information
Showing
8 changed files
with
73 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,42 @@ on: | |
- "published" | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-22.04 | ||
name: Update package version numbers | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Extract version number from tag | ||
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/*/} | ||
- name: Test output vars | ||
env: | ||
RELEASE_VERSION: ${{ steps.meta.vars.outputs.tag }} | ||
run: echo $RELEASE_VERSION | ||
# - name: Update API version in package files | ||
# uses: ciiiii/[email protected] | ||
# with: | ||
# file: api/Ballerina.toml | ||
# key: "package.version" | ||
# value: ${{ steps.vars.outputs.tag }} | ||
# - name: Update client version in package files | ||
# uses: ciiiii/[email protected] | ||
# with: | ||
# file: client/Ballerina.toml | ||
# key: "package.version" | ||
# value: ${{ steps.vars.outputs.tag }} | ||
# - name: Commit version changes to repository | ||
# uses: EndBug/add-and-commit@v9 # See: https://github.com/marketplace/actions/add-commit | ||
# with: | ||
# add: "." | ||
# push: origin main | ||
# default_author: github_actions | ||
# message: "[GitHub Actions] Commit version updates" | ||
update-staging-db: | ||
name: Update Azure staging database | ||
needs: update-version | ||
runs-on: ubuntu-22.04 | ||
environment: Staging | ||
permissions: | ||
|
@@ -26,3 +60,24 @@ 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 | ||
env: | ||
WORKING_DIR: client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
target | ||
Dependencies.toml |
Oops, something went wrong.