diff --git a/.github/workflows/new_release.yml b/.github/workflows/new_release.yml index ac59903a5..b8ecf2bca 100644 --- a/.github/workflows/new_release.yml +++ b/.github/workflows/new_release.yml @@ -1,15 +1,36 @@ -name: Release project +name: New Release + on: workflow_dispatch: + inputs: + tag: + description: "The tag version you want to release" jobs: - release: - name: Release + create-release: runs-on: ubuntu-latest - steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v2 - - name: Release - uses: huggingface/semver-release-action@latest + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 14 + + - name: Install gh CLI + run: npm install -g gh + + - name: Set up Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Login to GitHub with token + run: gh auth login --with-token <<<"${{ secrets.GH_TOKEN }}" + + - name: Create GitHub Release + if: success() + run: | + # Create a release with the specified tag + gh release create ${{ github.event.inputs.tag }} -t "${{ github.event.inputs.tag }}" -n "Release ${{ github.event.inputs.tag }}"