Skip to content

feat(SPV-839): add requesterPaymail when adding contact (#78) #350

feat(SPV-839): add requesterPaymail when adding contact (#78)

feat(SPV-839): add requesterPaymail when adding contact (#78) #350

Workflow file for this run

name: Go
permissions:
contents: write
pull-requests: read
on:
push:
tags:
- '*'
branches: [ master,main ]
pull_request:
branches: [ master,main ]
jobs:
error-lint:
name: error-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --config=./.golangci-lint.yml
style-lint:
name: style-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: golangci-style-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --config=./.golangci-style.yml
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go from go.mod
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Clean test cache
run: go clean -testcache
- name: Build
run: go build -v ./...
- name: Tests
run: go test -v ./... -race
build-darwin-artifacts:
if: startsWith(github.ref, 'refs/tags/v')
needs: [ error-lint,style-lint,test ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: -f release/.goreleaser-darwin.yml release --clean --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: bin-darwin
path: dist/${{ github.event.repository.name }}_*.tar.gz
release-linux:
if: startsWith(github.ref, 'refs/tags/v')
needs: [ build-darwin-artifacts ]
runs-on: ubuntu-latest
steps:
- name: Setup Dockerhub repo based on var
if: vars.DOCKERHUB_REPO != null
run: |
echo "DOCKERHUB_REPO=${{vars.DOCKERHUB_REPO}}" >> $GITHUB_ENV
- name: Default Dockerhub repo to on project name
if: vars.DOCKERHUB_REPO == null
run: |
echo "DOCKERHUB_REPO=$(basename ${GITHUB_REPOSITORY})" >> $GITHUB_ENV
- name: Setup Dockerhub owner based on var
if: vars.DOCKERHUB_OWNER != null
run: |
echo "DOCKERHUB_OWNER=${{vars.DOCKERHUB_OWNER}}" >> $GITHUB_ENV
- name: Default Dockerhub owner to dockerhub username
if: vars.DOCKERHUB_OWNER == null
run: |
echo "DOCKERHUB_OWNER=${{secrets.DOCKERHUB_USERNAME}}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Make directory for darwin bin
run: |
mkdir -p ./release/artifacts/darwin
- name: Download Darwin binaries
uses: actions/download-artifact@v4
with:
name: bin-darwin
path: ./release/artifacts/darwin
# Uncomment if you need CGO_ENABLED=1
# - name: Install cross-compiler for linux/arm64
# run: sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Prepare README for dockerhub
run: |
envsubst < ./release/README.DOCKER.md > ./release/artifacts/README.DOCKER.md
- name: Go Release
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: -f release/.goreleaser-linux.yml release --clean --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKERHUB_USERNAME: ${{ env.DOCKERHUB_OWNER }}
DOCKERHUB_REPONAME: ${{ env.DOCKERHUB_REPO }}
SOURCE_URL: ${{ github.event.repository.url }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
short-description: ${{ github.event.repository.description }}
repository: ${{ env.DOCKERHUB_OWNER }}/${{ env.DOCKERHUB_REPO }}
readme-filepath: ./release/artifacts/README.DOCKER.md