Skip to content

Update composeImage.yml #15

Update composeImage.yml

Update composeImage.yml #15

Workflow file for this run

name: 构建 Go 二进制文件
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检出仓库
uses: actions/checkout@v4
- name: 缓存 Go 模块
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: 设置 Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

Check failure on line 30 in .github/workflows/composeImage.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/composeImage.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
- name: 编译二进制文件
run: |
go build -v -o composeImage ./...
- name: 创建 Release
if: github.event_name == 'release'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: 上传编译文件到 Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: bin/composeImage.zip
asset_name: composeImage.zip
asset_content_type: application/zip