Add gitea specific workflow
This commit is contained in:
2 files changed
+88
-2
No files matched your search
@@ -0,0 +1,86 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build ${{ matrix.name }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- goos: linux
|
||||
goarch: amd64
|
||||
name: linux-amd64
|
||||
extension: ""
|
||||
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
name: linux-arm64
|
||||
extension: ""
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: stable
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
CGO_ENABLED: 0
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
mkdir -p dist
|
||||
go build \
|
||||
-ldflags="-X main.version=${VERSION}" \
|
||||
-o "dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }}" \
|
||||
.
|
||||
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cryosparc-merlin-${{ matrix.name }}
|
||||
path: dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }}
|
||||
|
||||
release:
|
||||
name: Create release
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download binaries
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
pattern: cryosparc-merlin-*
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- name: Generate checksums
|
||||
working-directory: dist
|
||||
run: |
|
||||
sha256sum * > checksums.txt
|
||||
|
||||
- name: Create Gitea Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
server_url: ${{ gitea.server_url }}
|
||||
repository: ${{ gitea.repository }}
|
||||
tag_name: ${{ gitea.ref_name }}
|
||||
name: ${{ gitea.ref_name }}
|
||||
body: |
|
||||
Release ${{ gitea.ref_name }}
|
||||
files: |
|
||||
dist/cryosparc-merlin-*
|
||||
dist/checksums.txt
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
.
|
||||
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: cryosparc-merlin-${{ matrix.name }}
|
||||
path: dist/cryosparc-merlin-${{ matrix.name }}${{ matrix.extension }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download binaries
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: cryosparc-merlin-*
|
||||
path: dist
|
||||
|
||||
Reference in new issue
Block a user