Skip to content

GoMod update: Bump github.com/cloudflare/cloudflare-go #209

GoMod update: Bump github.com/cloudflare/cloudflare-go

GoMod update: Bump github.com/cloudflare/cloudflare-go #209

Workflow file for this run

name: Go Checks
on:
push:
branches:
- '**'
tags:
- 'v*'
paths:
- 'go.sum'
- 'go.mod'
- '**.go'
- .github/workflows/golang.yml
pull_request:
branches:
- main
paths:
- 'go.sum'
- 'go.mod'
permissions:
security-events: write
actions: write
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Snapshot:
if: ${{ startsWith(github.ref, 'refs/tags/v') == false }}
runs-on: windows-latest
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: false
- uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: go-${{ hashFiles('go.sum') }}
- name: Install Syft
run: choco install syft --yes
#- name: Test
# run: make test
- name: Download AutoComplete file
run: Invoke-WebRequest -Uri https://raw.githubusercontent.com/urfave/cli/v2.25.7/autocomplete/bash_autocomplete -OutFile bash_completion
- name: GoReleaser Action
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: --snapshot --clean --skip=publish,sign
workdir: cmd/cloudflare-utils
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload assets
uses: actions/upload-artifact@v3
with:
name: cloudflare-utils
path: cmd/cloudflare-utils/dist/*
Docker:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
with:
username: cyb3rjak3
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: cyb3rjak3/cloudflare-utils,ghcr.io/cyb3r-jak3/cloudflare-utils
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout code
uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6, linux/386
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: dist.Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
with:
username: cyb3rjak3
password: ${{ secrets.DOCKER_PASSWORD }}
repository: cyb3rjak3/cloudflare-utils
Release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: false
- name: Install Syft
run: choco install syft --yes
- uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: go-${{ hashFiles('go.sum') }}
- name: Download AutoComplete file
run: Invoke-WebRequest -Uri https://raw.githubusercontent.com/urfave/cli/v2.25.7/autocomplete/bash_autocomplete -OutFile bash_completion
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
workdir: cmd/cloudflare-utils
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}