Clearer errors for unopened accountts #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Test, and Push Docker Image | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.22 | |
- name: Install ocl-icd-opencl-dev | |
run: sudo apt-get update && sudo apt-get install -y ocl-icd-opencl-dev | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get the version from the tag | |
id: get_version | |
run: | | |
VERSION=${GITHUB_REF##*/} | |
VERSION=${VERSION#v} | |
echo "::set-output name=VERSION::${VERSION}" | |
env: | |
VERSION: ${{ github.ref }} | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Run Tests | |
run: | | |
go test -v -parallel 1 $(go list -f '{{.Dir}}/...' -m | xargs) | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: bananocoin/pippin:latest,bananocoin/pippin:${{ steps.get_version.outputs.VERSION }} | |
build-args: VERSION=${{ steps.get_version.outputs.VERSION }} | |
- name: Build amd64 binary | |
run: | | |
GOARCH=amd64 go build -a -ldflags "-s -w -X main.Version=${{ steps.get_version.outputs.VERSION }}" -o pippin-nocl-amd64 ./apps/cli | |
env: | |
GOOS: linux | |
- name: Build amd64 opencl binary | |
run: | | |
GOARCH=amd64 go build -tags cl -a -ldflags "-s -w -X main.Version=${{ steps.get_version.outputs.VERSION }}" -o pippin-opencl-amd64 ./apps/cli | |
env: | |
GOOS: linux | |
- name: Build arm64 binary | |
run: | | |
GOARCH=arm64 go build -a -ldflags "-s -w -X main.Version=${{ steps.get_version.outputs.VERSION }}" -o pippin-nocl-arm64 ./apps/cli | |
env: | |
GOOS: linux | |
- name: Upload amd64 binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pippin-nocl-amd64 | |
path: pippin-nocl-amd64 | |
- name: Upload amd64 opencl binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pippin-opencl-amd64 | |
path: pippin-opencl-amd64 | |
- name: Upload arm64 binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pippin-nocl-arm64 | |
path: pippin-nocl-arm64 | |
create_release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download amd64 binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: pippin-nocl-amd64 | |
path: . | |
- name: Download amd6 opencl binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: pippin-opencl-amd64 | |
path: . | |
- name: Download arm64 binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: pippin-nocl-arm64 | |
path: . | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.build.outputs.version }} | |
release_name: Pippin v${{ needs.build.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./pippin-nocl-amd64 | |
asset_name: pippin-nocl-amd64 | |
asset_content_type: application/octet-stream | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./pippin-opencl-amd64 | |
asset_name: pippin-opencl-amd64 | |
asset_content_type: application/octet-stream | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./pippin-nocl-arm64 | |
asset_name: pippin-nocl-arm64 | |
asset_content_type: application/octet-stream |