Skip to content

Commit

Permalink
GH-158 关闭close自动打包
Browse files Browse the repository at this point in the history
  • Loading branch information
ispong authored May 24, 2024
1 parent 01c9877 commit 670c773
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 27 deletions.
32 changes: 5 additions & 27 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: release project

on:
workflow_dispatch:
inputs:
admin_github_token:
description: '管理员github token'
required: true
type: string

env:
ADMIN_GITHUB_TOKEN: ${{ inputs.admin_github_token }}
issues:
types:
- closed

jobs:

Expand All @@ -22,7 +16,7 @@ jobs:
- name: Checkout isx-cli
uses: actions/checkout@v4
with:
token: ${{ env.ADMIN_GITHUB_TOKEN }}
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
repository: "isxcode/isx-cli"
ref: 'main'

Expand All @@ -41,7 +35,7 @@ jobs:
with:
go-version-file: './go.mod'

- name: install go modules
- name: Install go modules
run: |
go env -w GO111MODULE=auto
go mod tidy
Expand All @@ -59,22 +53,6 @@ jobs:
- name: isx_darwin_amd64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./target/isx_darwin_amd64 main.go

# - name: Upload file
# uses: actions/upload-artifact@v3
# with:
# name: i-artifact
# path: |
# ./target/isx_windows_amd64.exe
# ./target/isx_linux_amd64
# ./target/isx_darwin_arm64
# ./target/isx_darwin_amd64

# - name: Push to github
# uses: softprops/action-gh-release@v1
# with:
# files: target/*
# token: ${{ env.ADMIN_GITHUB_TOKEN }}

- name: Upload Package to Ali oss
uses: chf007/aliyun-oss-upload-action@main
env:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: tag package

on:
release:
types: [published]

jobs:

package:

runs-on: ubuntu-latest

steps:

- name: Checkout isx-cli
uses: actions/checkout@v4

- name: Cache go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup go env
uses: actions/[email protected]
with:
go-version-file: './go.mod'

- name: Install go modules
run: |
go env -w GO111MODULE=auto
go mod tidy
go install
- name: isx_windows_amd64
run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./target/isx_windows_amd64.exe main.go

- name: isx_linux_amd64
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./target/isx_linux_amd64 main.go

- name: isx_darwin_arm64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ./target/isx_darwin_arm64 main.go

- name: isx_darwin_amd64
run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./target/isx_darwin_amd64 main.go

- name: Upload BinaryFile
uses: actions/upload-artifact@v3
with:
name: i-artifact
path: |
./target/isx_windows_amd64.exe
./target/isx_linux_amd64
./target/isx_darwin_arm64
./target/isx_darwin_amd64
- name: Publish to github
uses: softprops/action-gh-release@v1
with:
files: target/*
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

0 comments on commit 670c773

Please sign in to comment.