Create Release And Upload assets #128
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
name: Create Release And Upload assets | |
jobs: | |
create-realese: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get version | |
id: get_version | |
run: | | |
TAG=$(basename ${GITHUB_REF}) | |
VERSION=${TAG/v/} | |
echo "::set-output name=TAG::$TAG" | |
echo "::set-output name=VERSION::$VERSION" | |
- name: Create Release | |
id: create_release | |
uses: release-drafter/release-drafter@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
config-name: release-config.yml | |
version: ${{ steps.get_version.outputs.VERSION }} | |
tag: ${{ steps.get_version.outputs.TAG }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Create offline pip packages | |
env: | |
VERSION: ${{ steps.get_version.outputs.TAG }} | |
run: | | |
echo "build offline pip packages..." | |
pip download --only-binary=:all: \ | |
-d pip_packages \ | |
--platform win_amd64 \ | |
--python-version 3.11.6 --abi cp311 -r requirements.txt | |
cp -rf requirements.txt pip_packages | |
zip -r pip_packages.zip pip_packages | |
mkdir -p build && mv pip_packages.zip build | |
ls -l build | |
- name: Release Upload Assets | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: | | |
./build/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |