Skip to content

Commit

Permalink
Update Release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 authored Apr 8, 2024
1 parent f2d8185 commit 6d48e5a
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Go Build and Release

on:
push:
tags:
- 'v*'
branches:
- main
paths-ignore:
- 'README.md'
workflow_dispatch:

jobs:
build:
Expand All @@ -29,35 +32,34 @@ jobs:
- name: Package
run: |
TAG_NAME=${GITHUB_REF##*/}
tar -czvf ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${TAG_NAME}.tar.gz ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}
tar -czvf ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${GITHUB_REF_NAME}.tar.gz ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${{ github.ref_name }}.tar.gz
path: ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${{ github.ref_name }}.tar.gz
name: ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${GITHUB_REF_NAME}.tar.gz
path: ${{ github.event.repository.name }}_${{ matrix.os }}_${{ matrix.arch }}_${GITHUB_REF_NAME}.tar.gz

release:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
files: |
${{ github.event.repository.name }}_linux_amd64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_linux_arm64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_windows_amd64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_windows_arm64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_darwin_amd64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_darwin_arm64_${{ github.ref_name }}.tar.gz
${{ github.event.repository.name }}_linux_amd64_${GITHUB_REF_NAME}.tar.gz
${{ github.event.repository.name }}_linux_arm64_${GITHUB_REF_NAME}.tar.gz
${{ github.event.repository.name }}_windows_amd64_${GITHUB_REF_NAME}.tar.gz
${{ github.event.repository.name }}_windows_arm64_${GITHUB_REF_NAME}.tar.gz
${{ github.event.repository.name }}_darwin_amd64_${GITHUB_REF_NAME}.tar.gz
${{ github.event.repository.name }}_darwin_arm64_${GITHUB_REF_NAME}.tar.gz

0 comments on commit 6d48e5a

Please sign in to comment.