ci: update release workflow
Some checks failed
Go CI Pipeline / ci (push) Successful in 24s
Release Builds / build (darwin, macos-latest) (push) Successful in 31s
Release Builds / build (linux, ubuntu-latest) (push) Successful in 33s
Release Builds / build (windows, windows-latest) (push) Successful in 30s
Release Builds / create_release (push) Has been cancelled
Some checks failed
Go CI Pipeline / ci (push) Successful in 24s
Release Builds / build (darwin, macos-latest) (push) Successful in 31s
Release Builds / build (linux, ubuntu-latest) (push) Successful in 33s
Release Builds / build (windows, windows-latest) (push) Successful in 30s
Release Builds / create_release (push) Has been cancelled
This commit is contained in:
parent
1f588c771a
commit
efe25d3f2e
1 changed files with 64 additions and 3 deletions
|
|
@ -40,11 +40,72 @@ jobs:
|
|||
|
||||
- name: Build for ${{ matrix.goos }}
|
||||
run: |
|
||||
GOOS=${{ matrix.goos }} GOARCH=amd64 go build -o workctl-${{ matrix.goos }} .
|
||||
BUILD_NAME="workctl-${{ matrix.goos }}"
|
||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||
BUILD_NAME="${BUILD_NAME}.exe"
|
||||
fi
|
||||
GOOS=${{ matrix.goos }} GOARCH=amd64 go build -o ${BUILD_NAME} .
|
||||
ls -la
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: workctl-${{ matrix.goos }}
|
||||
path: workctl-${{ matrix.goos }}
|
||||
path: workctl-${{ matrix.goos }}${{ matrix.goos == 'windows' && '.exe' || '' }}
|
||||
retention-days: 7
|
||||
|
||||
create_release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- 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.GITEA_TOKEN }}
|
||||
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@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||
with:
|
||||
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:
|
||||
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:
|
||||
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