2024-09-20 23:19:31 -04:00
|
|
|
name: release
|
|
|
|
run-name: ${{ gitea.actor }} is releasing.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker-release-tag:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: docker buildx setup
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: login to container registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: git.hl.srp.life
|
|
|
|
username: ${{ gitea.repository_owner }}
|
|
|
|
password: ${{ secrets.ACTIONS_KEY }}
|
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: build and push to registry
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
git.hl.srp.life/${{ gitea.repository }}:${{ gitea.ref_name }}
|
|
|
|
docker-release-latest:
|
2024-09-20 23:54:41 -04:00
|
|
|
if: ${{ ! (endsWith(gitea.ref_name, '-alpha') || endsWith(gitea.ref_name, '-beta') || endsWith(gitea.ref_name, '-rc')) }}
|
2024-09-20 23:19:31 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: docker buildx setup
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: login to container registry
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: git.hl.srp.life
|
|
|
|
username: ${{ gitea.repository_owner }}
|
|
|
|
password: ${{ secrets.ACTIONS_KEY }}
|
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: build and push to registry
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: |
|
|
|
|
linux/amd64
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
git.hl.srp.life/${{ gitea.repository }}:latest
|
|
|
|
go-release-tag:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v4
|
2024-09-21 00:37:36 -04:00
|
|
|
- name: setup go 1.23.1 and fetch deps
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: '1.23.1'
|
|
|
|
cache-dependency-path: go.sum
|
2024-09-20 23:19:31 -04:00
|
|
|
- name: gotta build 'em all
|
2024-09-23 22:32:02 -04:00
|
|
|
uses: https://git.hl.srp.life/srp/go-cross-build@v3
|
2024-09-20 23:19:31 -04:00
|
|
|
with:
|
|
|
|
platforms: 'linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, freebsd/amd64, netbsd/amd64, openbsd/amd64, windows/amd64'
|
|
|
|
name: bingo
|
|
|
|
package: ''
|
|
|
|
compress: true
|
|
|
|
dest: dist
|
|
|
|
- name: push to go package registry
|
|
|
|
run: |
|
|
|
|
for i in dist/*; do
|
|
|
|
curl --user ${{ gitea.repository_owner }}:${{ secrets.ACTIONS_KEY }} --upload-file $i https://git.hl.srp.life/api/packages/${{ gitea.repository_owner }}/go/upload
|
|
|
|
done
|
|
|
|
- name: publish release
|
|
|
|
uses: https://gitea.com/actions/release-action@main
|
|
|
|
with:
|
|
|
|
files: |-
|
|
|
|
dist/**
|
|
|
|
api_key: ${{ secrets.ACTIONS_KEY }}
|