Skip to content

Test Publish Release #479

Test Publish Release

Test Publish Release #479

Workflow file for this run

name: Test Publish Release
on:
workflow_dispatch:
inputs:
tool-version:
description: 'The version of the tool to release'
required: true
default: 'v1.0.1'
permissions:
contents: write
jobs:
release:
name: Release pushed tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "priya gupta"
- name: Tag and Push Release
run: |
git tag -a ${{ github.event.inputs.tool-version }} -m "Release ${{ github.event.inputs.tool-version }}"
git push origin ${{ github.event.inputs.tool-version }}
- name: Publish Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
LATEST_COMMIT=$(git rev-parse HEAD)
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
# Retry mechanism for the release assets
for i in {1..5}; do
gh release create "${{ github.event.inputs.tool-version }}-${{ github.run_id }}" --draft --title "Release $LATEST_COMMIT" \
--notes "" \
"https://github.com/priyagupta108/sample-python/archive/refs/tags/$LATEST_TAG.zip#sample-python-$LATEST_TAG.zip" \
"https://github.com/priyagupta108/sample-python/archive/refs/tags/$LATEST_TAG.tar.gz#sample-python-$LATEST_TAG.tar.gz" && break || sleep 10
done