Another try at releasing.
Some checks failed
Build Docker image / build (push) Successful in 56s
Build Golang packages / release (push) Has been cancelled

This commit is contained in:
Pieter Hollander 2024-02-21 19:27:14 +01:00
parent 31a7fb255a
commit 1956094e32
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -13,10 +13,9 @@ jobs:
release:
runs-on: ubuntu-docker
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup go
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '>=1.x'
@ -33,10 +32,19 @@ jobs:
- name: release-build-darwin-arm64
run: GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-darwin-arm64
- name: Use Go Action
id: use-go-action
uses: softprops/action-gh-release
with:
files: |-
bin/**
api_key: '${{secrets.RELEASE_TOKEN}}'
- name: Create Release
id: create_release
env:
GITEA_TOKEN: ${{ secrets.CI_PACKAGES_RW }}
run: |
RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" -H "Authorization: token ${GITEA_TOKEN}" \
-d '{
"tag_name": "${{ github.ref_name }}",
"target_commitish": "main",
"name": "Release ${{ github.ref_name }}",
"body": "Description of the release",
"draft": false,
"prerelease": false
}' \
"https://git.hollander.online/api/v1/repos/${{ gitea.repository_owner }}/${{ gitea.event.repository.name }}/releases")
echo "::set-output name=id::$(echo $RESPONSE | jq .id)"