Skip to content

fix notebook description (#138) #77

fix notebook description (#138)

fix notebook description (#138) #77

name: Upload Release Assets
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
# Needed for creating tag
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Set current date as env variable
run: echo "DATETIME=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
# - name: Bump version and push tag
# id: tag_version
# uses: mathieudutour/[email protected]
# with:
# custom_tag: v${{ env.DATETIME }}
# tag_prefix: ""
# github_token: ${{ secrets.GITHUB_TOKEN }}
# run:
# git config --global user.name "${GITHUB_ACTOR}"
# git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# git tag "v${{ env.DATETIME }}"
# git push origin "v${{ env.DATETIME }}"
- name: Bump version and push tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ env.DATETIME }}",
sha: context.sha
})
- name: Build notebooks
run: |
python resources/package-samples.py notebooks --strip-output --outfile notebooks-stripped.zip --notebooks all
python resources/package-samples.py notebooks --outfile notebooks-full.zip --notebooks all
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.DATETIME }}
release_name: Release v${{ env.DATETIME }}
draft: false
prerelease: false
# This pulls from the CREATE RELEASE step above, referencing
# it's ID to get its outputs object, which include a `upload_url`.
# See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- name: Upload Stripped Asset
id: upload-stripped-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./notebooks-stripped.zip
asset_name: notebooks-stripped.zip
asset_content_type: application/zip
- name: Upload Full Asset
id: upload-full-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./notebooks-full.zip
asset_name: notebooks-full.zip
asset_content_type: application/zip