generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daichi Sakaue <[email protected]>
- Loading branch information
Showing
4 changed files
with
50 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
description: The name of the tag to release (X.Y.Z) | ||
jobs: | ||
release: | ||
name: Release network-policy-viewer | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Validate inputs | ||
run: | | ||
if [[ ! ${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Invalid tag format. Please use X.Y.Z" | ||
exit 1 | ||
fi | ||
if git rev-parse v${{ inputs.tag }} >/dev/null 2>&1; then | ||
echo "Tag v${{ inputs.tag }} already exists" | ||
exit 1 | ||
fi | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
- name: Build | ||
run: | | ||
make build | ||
cd bin; tar -czvf npv_v${{ inputs.tag }}_amd64.tar.gz npv | ||
- name: Setup Git Config | ||
run: | | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
- name: Push tag | ||
run: | | ||
git tag -a v${{ inputs.tag }} -m "Release network-policy-viewer v${{ inputs.tag }}" | ||
git push origin v${{ inputs.tag }} | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create v${{ inputs.tag }} --title "Release v${{ inputs.tag }}" --generate-notes | ||
gh release upload v${{ inputs.tag }} bin/npv_v${{ inputs.tag }}_amd64.tar.gz --clobber |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters