Skip to content

Add tag during release workflow #5

Add tag during release workflow

Add tag during release workflow #5

Workflow file for this run

name: Publish
on:
push:
branches: "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.2"
- name: Build Artifacts
run: make
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H:%M:%S.%3NZ')"
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.date.outputs.date }}',
sha: context.sha
})
- name: Publish to GitHub Releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ steps.date.outputs.date }} ./build/2rm