Skip to content

Commit 445e895

Browse files
committed
ci: create tag
1 parent 7954f4b commit 445e895

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/docker-publish.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,28 @@ jobs:
3838
run: |
3939
echo "BINARY_NAME=$(cargo metadata --offline --no-deps --format-version=1 | jq -r '.packages[].targets[] | select(.kind | map(. == "bin") | any ) | .name')" >> $GITHUB_OUTPUT
4040
41+
create-tag:
42+
runs-on: ubuntu-latest
43+
permissions:
44+
contents: write
45+
steps:
46+
- if: ${{ inputs.tag-name }}
47+
name: Create tag
48+
run: |
49+
gh api \
50+
--method POST \
51+
-H "Accept: application/vnd.github+json" \
52+
-H "X-GitHub-Api-Version: 2022-11-28" \
53+
"/repos/$OWNER_REPO/git/refs" \
54+
-f "ref=refs/tags/$TAG" -f "sha=$SHA"
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
OWNER_REPO: ${{ github.repository }}
58+
TAG: ${{ inputs.tag-name }}
59+
SHA: ${{ github.sha }}
60+
4161
build:
42-
needs: [env]
62+
needs: [create-tag, env]
4363
permissions:
4464
contents: write
4565
packages: write

0 commit comments

Comments
 (0)