fix(deps): update module github.com/minio/minio-go/v7 to v7.0.91 (#6) #20
This file contains hidden or 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
| name: Auto Release | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| output: files-api-linux-amd64 # 修改产物名称 | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: arm64 | |
| output: files-api-linux-arm64 # 修改产物名称 | |
| - os: ubuntu-latest | |
| goos: windows | |
| goarch: amd64 | |
| output: files-api-windows-amd64.exe # 修改产物名称 | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| go build -v -o ${{ matrix.output }} | |
| - name: Archive artifacts | |
| run: | | |
| tar czf ${{ matrix.output }}.tar.gz ${{ matrix.output }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: ${{ matrix.output }}.tar.gz | |
| create-release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取完整的提交历史 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| COMMIT_HASH=$(git rev-parse --short HEAD) | |
| # 获取上次发布的tag | |
| LAST_RELEASE=$(gh release list -L 1 | cut -f 3) | |
| if [ -z "$LAST_RELEASE" ]; then | |
| # 如果是首次发布,获取所有提交 | |
| COMMIT_LOG=$(git log --pretty=format:"- %s (%h)" --reverse) | |
| else | |
| # 获取从上次发布到现在的所有提交 | |
| COMMIT_LOG=$(git log ${LAST_RELEASE}..HEAD --pretty=format:"- %s (%h)" --reverse) | |
| fi | |
| # 创建临时文件存储发布说明 | |
| cat > release_notes.md << EOL | |
| ## Changes since last release | |
| ${COMMIT_LOG} | |
| ## Build Information | |
| - Build Time: $(date -u '+%Y-%m-%d %H:%M:%S UTC') | |
| - Commit: ${COMMIT_HASH} | |
| EOL | |
| # 创建release,使用所有提交记录作为发布说明 | |
| gh release create ${COMMIT_HASH} \ | |
| --title "Release ${COMMIT_HASH}" \ | |
| --notes-file release_notes.md \ | |
| artifacts/**/*.tar.gz |