51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: Release
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- "*"
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # release changes require contents write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: create versioned release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release create v${{ github.run_number }} --notes "Release ${{ github.run_number }}"
|
|
- name: remove last latest release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release delete latest
|
|
- name: create latest release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release create latest --notes "latest release"
|
|
release:
|
|
needs: setup
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.10"
|
|
- run: pip install hatch
|
|
- run: hatch run build
|
|
- name: Step 3 - Use the Upload Artifact GitHub Action
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: lsm-${{ matrix.os }}
|
|
path: dist
|
|
- name: Upload Release Asset
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release upload v${{ github.run_number }} dist/learn_sql_model*
|
|
- name: Upload Release Asset
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release upload latest dist/learn_sql_model*
|