Skip to content

using gh to release #12

using gh to release

using gh to release #12

Workflow file for this run

name: release workflow
# triggers the workflow on any push to a tag (including when a tag is created)
on:
push:
tags:
- "*"
jobs:
release-esm-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
- name: Install requirements
run: |
pip install -r requirements.txt
- name: Update project version
run: |
# set the version in the pyproject.toml to the git tag
(Get-Content pyproject.toml) -replace 'version\s*=\s*"(.*)"', "version = `"${{ github.ref_name }}`"" | Set-Content pyproject.toml
- name: Run PyInstaller
run: |
python -m PyInstaller esm.spec --noconfirm
- name: Info before release
run: |
echo "github.ref_name is: ${{ github.ref_name }}"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ github.ref_name }} dist/esm-${{ github.ref_name }}.zip
# uses: softprops/action-gh-release@v1
# with:
# files: dist/esm-${{ github.ref_name }}.zip
# prerelease: false
# - name: Create release
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ github.ref_name }}
# release_name: ${{ github.ref_name }}
# draft: false
# prerelease: false
# - name: create release
# uses: "marvinpinto/action-automatic-releases@latest"
# with:
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
# prerelease: false
# files: |
# dist\esm-${{ github.ref_name }}.zip
# - name: Create release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ github.ref_name }}
# run: |
# gh release create "$tag" \
# --repo="$GITHUB_REPOSITORY" \
# --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
# --generate-notes
# - name: Upload release artifact
# uses: actions/upload-release-asset@v1
# with:
# # upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist\esm-${{ github.ref_name }}.zip
# asset_name: esm-${{ github.ref_name }}.zip
# asset_content_type: application/zip