Skip to content

Commit

Permalink
ci: create tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi committed Aug 31, 2024
1 parent 7954f4b commit 445e895
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,28 @@ jobs:
run: |
echo "BINARY_NAME=$(cargo metadata --offline --no-deps --format-version=1 | jq -r '.packages[].targets[] | select(.kind | map(. == "bin") | any ) | .name')" >> $GITHUB_OUTPUT
create-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- if: ${{ inputs.tag-name }}
name: Create tag
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/repos/$OWNER_REPO/git/refs" \
-f "ref=refs/tags/$TAG" -f "sha=$SHA"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER_REPO: ${{ github.repository }}
TAG: ${{ inputs.tag-name }}
SHA: ${{ github.sha }}

build:
needs: [env]
needs: [create-tag, env]
permissions:
contents: write
packages: write
Expand Down

0 comments on commit 445e895

Please sign in to comment.