-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04d7338
commit bed3574
Showing
2 changed files
with
57 additions
and
7 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,57 @@ | ||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
name: Create and Publish release | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
id: go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.23 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Repo Name | ||
id: get_repo_name | ||
run: | | ||
# Extract repo name from GITHUB_REPOSITORY variable | ||
repo_fullname="${{ github.repository }}" | ||
repo_name="${repo_fullname##*/}" | ||
echo "REPO_NAME=${repo_name}" >> $GITHUB_ENV | ||
- name: Compile | ||
id: compile | ||
run: | | ||
make release | ||
- name: Get Tag Name | ||
id: get_tag_name | ||
run: | | ||
# Extract tag or branch name from GITHUB_REF | ||
tag_name="${{ github.ref }}" | ||
tag_name="${tag_name#refs/tags/}" | ||
echo "TAG_NAME=${tag_name}" >> $GITHUB_ENV | ||
- name: Create Release | ||
run: | | ||
echo "Repository Name: $REPO_NAME" | ||
echo "Tag Name: $TAG_NAME" | ||
git archive --format tbz2 --prefix="${REPO_NAME}/" --output "${REPO_NAME}-${TAG_NAME}.zip" HEAD | ||
echo "REPO_NAME=${REPO_NAME}" >> $GITHUB_ENV | ||
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV | ||
- name: Upload Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: "${{ github.event.repository.name }}-${{ steps.get_tag_name.outputs.TAG_NAME }}.zip" |
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