Skip to content

Add tag requirement #16

Add tag requirement

Add tag requirement #16

name: Upload Release Assets
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
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: 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: ${{ github.sha }}
release_name: Release ${{ github.sha }}
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