mirror of
https://github.com/Horizontal42/warehouse-master.git
synced 2026-11-11 02:32:01 +03:00
simplify ci: remove create-release job, fix token permissions
This commit is contained in:
parent
4eaa0aba84
commit
9ca81fa2e3
1 changed files with 6 additions and 26 deletions
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
|
|
@ -15,32 +15,7 @@ permissions:
|
|||
contents: write
|
||||
|
||||
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:
|
||||
needs: create-release
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -84,4 +59,9 @@ jobs:
|
|||
shell: bash
|
||||
env:
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue