Skip to content

Commit

Permalink
Github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefuertes committed Oct 30, 2024
1 parent 04d7338 commit bed3574
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 7 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
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"
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,3 @@ release: clean lint test
done; \
done
@ls -sSFhC1 release

release-push:
@for crunched_name in $$(ls -sSFhC1 release); do \
echo "Pushing $$crunched_name"; \
gh release upload $VERSION $$crunched_name; \
done
@echo "Released"

0 comments on commit bed3574

Please sign in to comment.