54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Main
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions: write-all
|
|
steps:
|
|
- uses: RouxAntoine/checkout@v3.5.4
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.20.4'
|
|
|
|
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
- run: make build VERSION=$RELEASE_VERSION GOOS=linux GOARCH=amd64 GO_BUILD_FLAGS="-tags prod"
|
|
if: env.RELEASE_VERSION != 'master'
|
|
|
|
- run: make build VERSION=$RELEASE_VERSION GOOS=linux GOARCH=amd64 GO_BUILD_FLAGS="-tags dev"
|
|
if: env.RELEASE_VERSION == 'master'
|
|
|
|
# - run: |
|
|
# echo "$GITHUB_TOKEN" >> secret.txt
|
|
# echo "${{ github.actor }}" >> secret.txt
|
|
# git config user.name github-actions
|
|
# git config user.email github-actions@github.com
|
|
# git add .
|
|
# git commit -m "generated"
|
|
# git push
|
|
|
|
- name: PUT binary as repository package
|
|
id: pushArtifact
|
|
uses: fjogeleit/http-request-action@v1
|
|
with:
|
|
url: "https://antoine-roux.tk/projects/api/packages/go/generic/docker-multi-arch-builder/$RELEASE_VERSION/docker-multi-arch-builder"
|
|
method: 'PUT'
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.PACKAGE_PUSH_TOKEN }}
|
|
# password: env.GITHUB_TOKEN
|
|
# customHeaders: '{"Authorization": "token $GITHUB_TOKEN"}'
|
|
timeout: 20000
|
|
file: "${{ github.workspace }}/bin/docker-multi-arch-builder-linux-amd64"
|
|
|
|
- name: Show Response
|
|
run: |
|
|
echo ${{ steps.pushArtifact.outputs.response }}
|
|
echo ${{ steps.pushArtifact.outputs.headers }}
|