From 20989272abcfd5bcd3ae4437b8e64a8613e54129 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Sun, 24 Jan 2021 22:53:58 -0500 Subject: [PATCH] fix(ci): Fix docs version I am also removing one of the unused Github actions that we implemented before dependabot, which has now been completely replaced by dependabot. --- .github/workflows/ci.yaml | 20 ++++----- .../workflows/honeybee-schema-release.yaml | 41 ------------------- docs.py | 2 - 3 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/honeybee-schema-release.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2692039..7b98ac0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,24 +54,24 @@ jobs: - name: install semantic-release run: npm install @semantic-release/exec - - name: generate docs for assets deployment - run: | - python docs.py $(echo $VERSION | sed 's/v//') - env: - VERSION: ${{ github.event.client_payload.version }} - name: run semantic release - run: + id: new_release + run: | + nextRelease="`npx semantic-release --dryRun | grep -oP 'Published release \K.*? ' || true`" npx semantic-release + echo "::set-output name=tag::$nextRelease" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + outputs: + tag: ${{ steps.new_release.outputs.tag }} docs: name: Generate docs runs-on: ubuntu-latest - needs: test - if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools' + needs: deploy + if: ${{ github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools' && contains(needs.deploy.outputs.tag, '.') }} steps: - uses: actions/checkout@v2 - name: set up Python @@ -91,10 +91,8 @@ jobs: pip install -r dev-requirements.txt - name: generate docs run: | - python docs.py $(echo $VERSION | sed 's/v//') + python docs.py --version ${{needs.deploy.outputs.tag}} redoc-cli bundle ./docs/model_redoc.json -o ./docs/model.html - env: - VERSION: ${{ github.event.client_payload.version }} - name: deploy to github pages uses: peaceiris/actions-gh-pages@v3 diff --git a/.github/workflows/honeybee-schema-release.yaml b/.github/workflows/honeybee-schema-release.yaml deleted file mode 100644 index d60a881..0000000 --- a/.github/workflows/honeybee-schema-release.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI-Honeybee-Schema-Release - -on: repository_dispatch - -jobs: - update_honeybee_schema: - name: "Update Honeybee Schema version" - runs-on: ubuntu-latest - if: github.event.action == 'honeybee_schema_release' - - steps: - - name: "Checkout Master Branch" - uses: actions/checkout@v1 - with: - ref: refs/heads/master - - - name: "Run Update Script" - env: - VERSION: ${{ github.event.client_payload.version }} - run: | - sed -i 's/honeybee-schema\S*/honeybee-schema=='"$(echo $VERSION | sed 's/v//')"'/' requirements.txt - - - name: "Set PR Variables" - id: pr_vars - env: - VERSION: ${{ github.event.client_payload.version }} - run: | - echo ::set-output name=commit_message::"fix(honeybee-schema): bump to $VERSION" - echo ::set-output name=pr_title::"Bump Honeybee Schema to $VERSION" - echo ::set-output name=pr_body::"Auto-generated Pull Request based on new release of honeybee-schema." - echo ::set-output name=pr_branch::"honeybee-schema-$VERSION" - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v1.5.4 - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - COMMIT_MESSAGE: ${{ steps.pr_vars.outputs.commit_message }} - PULL_REQUEST_TITLE: ${{ steps.pr_vars.outputs.pr_title }} - PULL_REQUEST_BODY: ${{ steps.pr_vars.outputs.pr_body }} - PULL_REQUEST_BRANCH: ${{ steps.pr_vars.outputs.pr_branch }} - PULL_REQUEST_BASE: master diff --git a/docs.py b/docs.py index ab06a48..bf57fd6 100644 --- a/docs.py +++ b/docs.py @@ -13,8 +13,6 @@ args = parser.parse_args() -VERSION = None - if args.version: VERSION = args.version.replace('v', '') else: