Skip to content

Update-cloudflared

Update-cloudflared #11

name: Build-cloudflared
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: 'cloudflare/cloudflared'
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- 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: Build
run: |
export GOARCH=""
export GOOS="linux"
for ARCH in aarch64_cortex-a53 aarch64_cortex-a72 aarch64_generic arc_archs arm_arm1176jzf-s_vfp arm_arm926ej-s arm_cortex-a15_neon-vfpv4 arm_cortex-a5_vfpv4 arm_cortex-a7 arm_cortex-a7_neon-vfpv4 arm_cortex-a7_vfpv4 arm_cortex-a8_vfpv3 arm_cortex-a9 arm_cortex-a9_neon arm_cortex-a9_vfpv3-d16 arm_fa526 arm_mpcore arm_xscale i386_pentium-mmx i386_pentium4 mips64_octeonplus mips_24kc mips_4kec mips_mips32 mipsel_24kc mipsel_24kc_24kf mipsel_74kc mipsel_mips32 powerpc_464fp powerpc_8540 x86_64
do
export GOARCH=$ARCH
go build -trimpath -ldflags "-s -w" ./cmd/cloudflared
zip cloudflared-$ARCH.zip cloudflared
done
- uses: actions/upload-artifact@v3
with:
name: cloudflared-binaries
path: ./*.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: cloudflared-binaries
- name: Get latest tag
id: latest_tag
uses: anothrNick/github-tag-action@1.35.0
env:
DEFAULT_BUMP: patch
WITH_V: true
DEFAULT_BRANCH: main
RELEASE_BRANCHES: main
GITHUB_TOKEN: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@v2
if: steps.latest_tag.outputs.new_tag
with:
tag_name: ${{ steps.latest_tag.outputs.new_tag }}
files: ./*.zip
token: ${{ github.token }}
fail_on_unmatched_files: false