|
| 1 | +name: Upload Release Asset |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + # Sequence of patterns matched against refs/tags |
| 6 | + tags: |
| 7 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Set up Python 3.11 |
| 18 | + uses: actions/setup-python@v3 |
| 19 | + with: |
| 20 | + python-version: "3.11" |
| 21 | + |
| 22 | + - name: Install dependencies |
| 23 | + run: | |
| 24 | + python -m pip install --upgrade pip |
| 25 | +
|
| 26 | + - name: Build project |
| 27 | + run: | |
| 28 | + python resources/package-samples.py notebooks |
| 29 | +
|
| 30 | + - name: Create Release |
| 31 | + id: create_release |
| 32 | + uses: actions/create-release@v1 |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + with: |
| 36 | + tag_name: ${{ github.ref }} |
| 37 | + release_name: Release ${{ github.ref }} |
| 38 | + draft: false |
| 39 | + prerelease: false |
| 40 | + |
| 41 | + - name: Upload Release Asset |
| 42 | + id: upload-release-asset |
| 43 | + uses: actions/upload-release-asset@v1 |
| 44 | + env: |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + with: |
| 47 | + # This pulls from the CREATE RELEASE step above, referencing |
| 48 | + # it's ID to get its outputs object, which include a `upload_url`. |
| 49 | + # See this blog post for more info: |
| 50 | + # https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 51 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 52 | + asset_path: ./sample-notebooks.zip |
| 53 | + asset_name: sample-notebooks.zip |
| 54 | + asset_content_type: application/zip |
0 commit comments