Skip to content

Commit

Permalink
ci: try with github cli
Browse files Browse the repository at this point in the history
  • Loading branch information
sanriodev committed Sep 24, 2024
1 parent 8452b66 commit 503369b
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
name: Release
name: Create Release

on:
push:
tags:
- 'v*' # This triggers on tags like v1.0, v1.1, etc.
- 'v*.*.*'

jobs:
release:
create_release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Set up GitHub CLI
uses: actions/setup-gh@v2

- name: Build project
run: go build -o goji ./...
- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"

- name: Create Release
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
run: gh release create ${{ github.ref }} --title "Release ${{ github.ref }}" --notes "Release ${{ github.ref }}"

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./goji
asset_name: goji
asset_content_type: application/octet-stream
run: gh release upload ${{ github.ref }} path/to/your/asset

0 comments on commit 503369b

Please sign in to comment.