-
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.
- Loading branch information
Showing
6 changed files
with
119 additions
and
19 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,94 @@ | ||
name: CreateRelease | ||
|
||
on: | ||
release: | ||
types: | ||
- prereleased | ||
# - released | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
create_release: | ||
if: github.event_name == 'push' | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
if: github.event_name == 'push' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref_name }} | ||
body: 修复了一些已知问题。 | ||
draft: false | ||
prerelease: true | ||
|
||
build: | ||
# if: github.event_name == 'release' | ||
# needs: create_release | ||
strategy: | ||
matrix: | ||
goos: [linux, darwin, windows] | ||
|
||
permissions: # 需要设置写权限才能自动发布 | ||
contents: write | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
CGO_ENABLED: 0 | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
go env -w GO111MODULE=on | ||
sudo apt-get update -y | ||
sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev | ||
go mod tidy | ||
go install fyne.io/fyne/v2/cmd/fyne@latest | ||
- name: Get File Name | ||
id: get_filename | ||
run: | | ||
export _NAME=DownUtils-${{ matrix.goos }}.tar.gz | ||
echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $_NAME" | ||
echo "ASSET_NAME=$_NAME" >> $GITHUB_OUTPUT | ||
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV | ||
- name: Build | ||
run: | | ||
fyne package -os ${{ matrix.goos }} -icon resource/images/logo.png | ||
ls *.exe *.tar* | ||
- name: Package | ||
run: tar zcvf ${{ steps.get_filename.outputs.ASSET_NAME }} *.exe *.tar* | ||
|
||
# 上传附件 | ||
- name: Upload file to Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.get_filename.outputs.ASSET_NAME }} | ||
path: ${{ steps.get_filename.outputs.ASSET_NAME }} | ||
|
||
- name: Upload files to GitHub release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file_glob: true | ||
file: ./${{ steps.get_filename.outputs.ASSET_NAME }} | ||
tag: ${{ github.ref }} | ||
overwrite: true |
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
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
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