diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 75064de..b5dde4a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,6 +16,14 @@ jobs: with: python-version: '3.8' + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Show version + run: | + echo $RELEASE_VERSION + echo ${{ env.RELEASE_VERSION }} + - name: Upgrade pip run: | # install pip=>20.1 to use "pip cache dir" @@ -25,22 +33,6 @@ jobs: id: pip-cache run: echo "::set-output name=dir::$(pip cache dir)" - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache install dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install dependencies run: python3 -m pip install -r ./requirements.txt @@ -50,13 +42,7 @@ jobs: - name: Compress docs uses: montudor/action-zip@v0.1.0 with: - args: zip -qq -r docs.zip ./doc_src/_build/html - - - name: Upload docs - uses: actions/upload-artifact@v2 - with: - name: ${{ github.ref }} - path: docs.zip + args: zip -qq -r pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip ./doc_src/_build/html - name: Create release uses: actions/create-release@v1 @@ -68,3 +54,11 @@ jobs: draft: false prerelease: false + - name: Upload docs to release + uses: actions/upload-release-asset@v1 + with: + name: ${{ github.ref }} + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip + asset_name: pyforhandbook_html_docs_${{ env.RELEASE_VERSION }}.zip + asset_content_type: application/zip