Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-158 关闭close自动打包 #159

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}