simplify ci: remove create-release job, fix token permissions

This commit is contained in:
Andrew Pimenov 2026-06-11 20:18:06 +03:00
parent 4eaa0aba84
commit 9ca81fa2e3

View file

@ -15,32 +15,7 @@ permissions:
contents: write contents: write
jobs: jobs:
create-release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: Resolve tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "value=${{ inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "value=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Ensure release exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "${{ steps.tag.outputs.value }}" --repo "${{ github.repository }}" 2>/dev/null || \
gh release create "${{ steps.tag.outputs.value }}" \
--repo "${{ github.repository }}" \
--title "${{ steps.tag.outputs.value }}" \
--generate-notes
build: build:
needs: create-release
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -84,4 +59,9 @@ jobs:
shell: bash shell: bash
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ needs.create-release.outputs.tag }}" "dist/${{ matrix.artifact }}" --clobber run: |
TAG="${{ github.ref_name }}"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ inputs.tag }}"
fi
gh release upload "$TAG" "dist/${{ matrix.artifact }}" --clobber