fix: try a different approuch
This commit is contained in:
parent
f9945a2685
commit
deb15af40e
1 changed files with 117 additions and 90 deletions
|
|
@ -7,105 +7,132 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: GoReleaser build
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
goos: [linux, darwin, windows]
|
|
||||||
exclude:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
goos: darwin
|
|
||||||
- os: ubuntu-latest
|
|
||||||
goos: windows
|
|
||||||
- os: macos-latest
|
|
||||||
goos: linux
|
|
||||||
- os: macos-latest
|
|
||||||
goos: windows
|
|
||||||
- os: windows-latest
|
|
||||||
goos: linux
|
|
||||||
- os: windows-latest
|
|
||||||
goos: darwin
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go 1.24
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.24'
|
go-version: 1.24
|
||||||
|
id: go
|
||||||
|
|
||||||
- name: Get dependencies
|
- name: Run GoReleaser
|
||||||
run: go mod tidy
|
uses: goreleaser/goreleaser-action@master
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: release --rm-dist
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
|
|
||||||
- name: Build for ${{ matrix.goos }}
|
# jobs:
|
||||||
run: |
|
# build:
|
||||||
BUILD_NAME="workctl-${{ matrix.goos }}"
|
# runs-on: ubuntu-22.04
|
||||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
# strategy:
|
||||||
BUILD_NAME="${BUILD_NAME}.exe"
|
# matrix:
|
||||||
fi
|
# os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
GOOS=${{ matrix.goos }} GOARCH=amd64 go build -o ${BUILD_NAME} .
|
# goos: [linux, darwin, windows]
|
||||||
ls -la
|
# exclude:
|
||||||
|
# - os: ubuntu-latest
|
||||||
|
# goos: darwin
|
||||||
|
# - os: ubuntu-latest
|
||||||
|
# goos: windows
|
||||||
|
# - os: macos-latest
|
||||||
|
# goos: linux
|
||||||
|
# - os: macos-latest
|
||||||
|
# goos: windows
|
||||||
|
# - os: windows-latest
|
||||||
|
# goos: linux
|
||||||
|
# - os: windows-latest
|
||||||
|
# goos: darwin
|
||||||
|
|
||||||
- name: Upload artifact
|
# steps:
|
||||||
uses: actions/upload-artifact@v3
|
# - name: Check out repository
|
||||||
with:
|
# uses: actions/checkout@v4
|
||||||
name: workctl-${{ matrix.goos }}
|
|
||||||
path: workctl-${{ matrix.goos }}${{ matrix.goos == 'windows' && '.exe' || '' }}
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
create_release:
|
# - name: Set up Go
|
||||||
needs: build
|
# uses: actions/setup-go@v5
|
||||||
runs-on: ubuntu-22.04
|
# with:
|
||||||
steps:
|
# go-version: '1.24'
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
# Dies ist der Token, der Forgejo erlaubt, das Release zu erstellen
|
|
||||||
# Du musst einen Gitea/Forgejo API-Token als Repository Secret (z.B. GITEA_TOKEN) hinterlegen.
|
|
||||||
# Der Token benötigt die Berechtigung "write:releases" oder "repo".
|
|
||||||
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
|
||||||
with:
|
|
||||||
url: https://git.patanix.de
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: Release ${{ github.ref }}
|
|
||||||
body: |
|
|
||||||
Dies ist ein automatisches Release von ${{ github.ref }}.
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
- name: Download all workflow artifacts
|
# - name: Get dependencies
|
||||||
uses: actions/download-artifact@v3
|
# run: go mod tidy
|
||||||
with:
|
|
||||||
path: ./artifacts
|
|
||||||
|
|
||||||
- name: Upload Release Asset (Linux)
|
# - name: Build for ${{ matrix.goos }}
|
||||||
uses: actions/upload-release-asset@v1
|
# run: |
|
||||||
env:
|
# BUILD_NAME="workctl-${{ matrix.goos }}"
|
||||||
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
# if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||||
with:
|
# BUILD_NAME="${BUILD_NAME}.exe"
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
# fi
|
||||||
asset_path: ./artifacts/workctl-linux/workctl-linux
|
# GOOS=${{ matrix.goos }} GOARCH=amd64 go build -o ${BUILD_NAME} .
|
||||||
asset_name: workctl-linux
|
# ls -la
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (macOS)
|
# - name: Upload artifact
|
||||||
uses: actions/upload-release-asset@v1
|
# uses: actions/upload-artifact@v3
|
||||||
env:
|
# with:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}$
|
# name: workctl-${{ matrix.goos }}
|
||||||
with:
|
# path: workctl-${{ matrix.goos }}${{ matrix.goos == 'windows' && '.exe' || '' }}
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
# retention-days: 7
|
||||||
asset_path: ./artifacts/workctl-darwin/workctl-darwin
|
|
||||||
asset_name: workctl-darwin
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload Release Asset (Windows)
|
# create_release:
|
||||||
uses: actions/upload-release-asset@v1
|
# needs: build
|
||||||
env:
|
# runs-on: ubuntu-22.04
|
||||||
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}$
|
# steps:
|
||||||
with:
|
# - name: Create Release
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
# id: create_release
|
||||||
asset_path: ./artifacts/workctl-windows/workctl-windows.exe
|
# uses: actions/create-release@v1
|
||||||
asset_name: workctl-windows.exe
|
# env:
|
||||||
asset_content_type: application/octet-stream
|
# # Dies ist der Token, der Forgejo erlaubt, das Release zu erstellen
|
||||||
|
# # Du musst einen Gitea/Forgejo API-Token als Repository Secret (z.B. GITEA_TOKEN) hinterlegen.
|
||||||
|
# # Der Token benötigt die Berechtigung "write:releases" oder "repo".
|
||||||
|
# GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
|
# with:
|
||||||
|
# url: https://git.patanix.de
|
||||||
|
# tag_name: ${{ github.ref }}
|
||||||
|
# release_name: Release ${{ github.ref }}
|
||||||
|
# body: |
|
||||||
|
# Dies ist ein automatisches Release von ${{ github.ref }}.
|
||||||
|
# draft: false
|
||||||
|
# prerelease: false
|
||||||
|
|
||||||
|
# - name: Download all workflow artifacts
|
||||||
|
# uses: actions/download-artifact@v3
|
||||||
|
# with:
|
||||||
|
# path: ./artifacts
|
||||||
|
|
||||||
|
# - name: Upload Release Asset (Linux)
|
||||||
|
# uses: actions/upload-release-asset@v4
|
||||||
|
# env:
|
||||||
|
# GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
|
# with:
|
||||||
|
# name: workctl-linux
|
||||||
|
# path: ./artifacts/workctl-linux/workctl-linux
|
||||||
|
# upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
# asset_path: ./artifacts/workctl-linux/workctl-linux
|
||||||
|
# asset_name: workctl-linux
|
||||||
|
# asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
# - name: Upload Release Asset (macOS)
|
||||||
|
# uses: actions/upload-release-asset@v1
|
||||||
|
# env:
|
||||||
|
# GITEA_TOKEN: ${{ secrets.GITEATOKEN }}$
|
||||||
|
# with:
|
||||||
|
# upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
# asset_path: ./artifacts/workctl-darwin/workctl-darwin
|
||||||
|
# asset_name: workctl-darwin
|
||||||
|
# asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
# - name: Upload Release Asset (Windows)
|
||||||
|
# uses: actions/upload-release-asset@v1
|
||||||
|
# env:
|
||||||
|
# GITEA_TOKEN: ${{ secrets.GITEATOKEN }}$
|
||||||
|
# with:
|
||||||
|
# upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
# asset_path: ./artifacts/workctl-windows/workctl-windows.exe
|
||||||
|
# asset_name: workctl-windows.exe
|
||||||
|
# asset_content_type: application/octet-stream
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue