Skip to content

Commit

Permalink
feat: create new version on release
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallesm committed Feb 13, 2024
1 parent cfbe0a4 commit 1647eba
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/sync-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Keep private (staging) docs in sync with `main`
runs-on: ubuntu-latest
outputs:
should_update_public: ${{ steps.check-new-release.outputs.is_new_release }}
new_release: ${{ steps.check-new-release.outputs.new_release }}
steps:
- name: Check out repo ๐Ÿ“š
uses: actions/checkout@v3
Expand All @@ -42,32 +42,24 @@ jobs:
- name: Check new release ๐Ÿ”
id: check-new-release
run: |
if [[ `git diff ${{ github.event.before }} ${{ github.event.after }} openapiv2/vdp openapiv2/core openapiv2/model | grep "^+\s\+version"` ]]; then
echo 'is_new_release=true' >> $GITHUB_OUTPUT
else
echo 'is_new_release=false' >> $GITHUB_OUTPUT
# If the version in the OpenAPI configuration has changed, set the
# new release version (without the "v" prefix) to a variable.
if [[ `git diff ${{ github.event.before }} ${{ github.event.after }} common/openapi/v1beta/api_info.conf | grep "^+\s\+version"` ]]; then
echo "new_release=$(grep version common/openapi/v1beta/api_info.conf | sed 's/.*\"v\(.*\)\".*/\1/')" >> $GITHUB_OUTPUT
fi
sync-openapi-public:
name: Sync public docs on new release
needs: [sync-openapi-private]
runs-on: ubuntu-latest
if: needs.sync-openapi-private.outputs.should_update_public == 'true'
if: needs.sync-openapi-private.outputs.new_release != ''
steps:
- name: Check out repo ๐Ÿ“š
uses: actions/checkout@v3

- name: Sync Core ๐Ÿ”ฎ
uses: readmeio/rdme@v8
with:
rdme: openapi openapiv2/core/service.swagger.yaml --key=${{ secrets.README_API_KEY }} --id=659fcafc3ca8be005651d43f

- name: Sync Model โš—๏ธ
uses: readmeio/rdme@v8
with:
rdme: openapi openapiv2/model/service.swagger.yaml --key=${{ secrets.README_API_KEY }} --id=65a6a52ab94959005b83f6fc

- name: Sync VDP ๐Ÿ’ง
- name: Create new version ๐Ÿš€
uses: readmeio/rdme@v8
env:
Release: ${{ needs.sync-openapi-private.outputs.new_release }}
with:
rdme: openapi openapiv2/vdp/service.swagger.yaml --key=${{ secrets.README_API_KEY }} --id=65a15372e7857a001655767c
rdme: versions:create ${{ env.Release }} --fork 0-beta-staging --codename=${{ env.Release}} --main true --beta true --isPublic true --key=${{ secrets.README_API_KEY }}

0 comments on commit 1647eba

Please sign in to comment.