From 9d69a0a706f46445d4fdb62325d8fb3c68559fe4 Mon Sep 17 00:00:00 2001 From: Jayachandra Poluri <160056265+JayEviden@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:01:01 -0700 Subject: [PATCH] Added release file --- .github/workflows/release.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b5caa62 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,62 @@ +# This pipeline is designed to create a wheel and publich the wheel on +# GitHub + +# Execute pipeline only on a new tag, if the tag +# if named "v*" (e.g. v1.0) +on: + push: + tags: + - 'v*' + + +# Pipeline name +name: Create new release + + +# Run pipeline +jobs: + build: + name: Build package + uses: ./.github/workflows/python-app.yml + deploy: + name: Deploy package + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python3 -m pip install build + - name: Compute release version + run: | + TAG=${{ github.ref }} + echo "VERSION=${TAG#refs/tags/v}" >> $GITHUB_ENV + echo "The release version if ${TAG#refs/tags/v}" + - name: Create wheel + env: + TAG_NAME: ${{ env.VERSION }} + run: python -m build + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION }} + draft: false + prerelease: false + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/mylib-${{ env.VERSION }}-py3-none-any.whl + asset_name: mylib-${{ env.VERSION }}-py3-none-any.whl + asset_content_type: application/x-wheel+zip