add linux package definitions to goreleaser configs

This commit is contained in:
Kenneth Bingham 2023-10-31 16:42:00 -04:00
parent 795b953845
commit 99268276bb
No known key found for this signature in database
GPG Key ID: 31709281860130B6
10 changed files with 248 additions and 105 deletions

View File

@ -10,6 +10,10 @@ on:
- 'docs/**'
- 'website/**'
# cancel older, redundant builds that haven't started yet
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
ubuntu-build:
name: Build Linux AMD64 CLI
@ -95,7 +99,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_API_USER }}
username: ${{ vars.DOCKER_HUB_API_USER || secrets.DOCKER_HUB_API_USER }}
password: ${{ secrets.DOCKER_HUB_API_TOKEN }}
- name: Set Up Container Image Tags for zrok CLI Container

View File

@ -5,6 +5,10 @@ on:
branches:
- main
# allow GITHUB_TOKEN to be used by the peaceiris/actions-gh-pages action to push to gh-pages branch
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest

View File

@ -6,14 +6,16 @@ on:
jobs:
update-brew:
if: github.repository_owner == 'openziti'
runs-on: ubuntu-latest
steps:
- name: Extract Version
id: extract-version
run: |
printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
echo "tag-name=${GITHUB_REF#refs/tags/}" | tee -a ${GITHUB_OUTPUT}
- uses: mislav/bump-homebrew-formula-action@v3.1
if: "!contains(github.ref, '-')"
if: ${{ !contains(github.ref, '-') }}
with:
formula-name: zrok
download-url: https://github.com/openziti/zrok/archive/refs/tags/${{ steps.extract-version.outputs.tag-name }}.tar.gz

View File

@ -24,7 +24,7 @@ jobs:
id: semver
run: |
zrok_semver=${RELEASE_REF#refs/tags/}
echo "zrok_semver=${zrok_semver#v}" >> $GITHUB_OUTPUT
echo "zrok_semver=${zrok_semver#v}" | tee -a $GITHUB_OUTPUT
- name: Checkout Workspace
uses: actions/checkout@v3
@ -67,7 +67,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_API_USER }}
username: ${{ vars.DOCKER_HUB_API_USER || secrets.DOCKER_HUB_API_USER }}
password: ${{ secrets.DOCKER_HUB_API_TOKEN }}
- name: Set Up Container Image Tags for zrok CLI Container
@ -76,10 +76,7 @@ jobs:
ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
id: tagprep_cli
run: |
DOCKER_TAGS=""
DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest"
echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
echo DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest" | tee -a $GITHUB_OUTPUT
# this is the CLI image with the Linux binary for each
# arch that was downloaded in ./dist/
@ -95,94 +92,3 @@ jobs:
DOCKER_BUILD_DIR=./docker/images/zrok
ARTIFACTS_DIR=./dist
push: true
# - name: Set Up Container Image Tags for zrok Controller Container
# env:
# RELEASE_REPO: openziti/zrok-controller
# ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
# id: tagprep_ctrl
# run: |
# DOCKER_TAGS=""
# DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest"
# echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
# echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
# # This is a use-case image based on the minimal CLI image. It needs the
# # ZROK_VERSION env var so it can build from the versioned image that
# # we pushed in the prior step.
# - name: Build & Push Multi-Platform Controller Container Image to Hub
# uses: docker/build-push-action@v3
# with:
# builder: ${{ steps.buildx.outputs.name }}
# context: ${{ github.workspace }}/docker/images/zrok-controller/
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.tagprep_ctrl.outputs.DOCKER_TAGS }}
# build-args: |
# ZROK_VERSION=${{ env.ZROK_VERSION }}
# push: true
# - name: Set Up Container Image Tags for zrok Frontend Container
# env:
# RELEASE_REPO: openziti/zrok-frontend
# ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
# id: tagprep_frontend
# run: |
# DOCKER_TAGS=""
# DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest"
# echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
# echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
# - name: Build & Push Multi-Platform Frontend Container Image to Hub
# uses: docker/build-push-action@v3
# with:
# builder: ${{ steps.buildx.outputs.name }}
# context: ${{ github.workspace }}/docker/images/zrok-frontend/
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.tagprep_frontend.outputs.DOCKER_TAGS }}
# build-args: |
# ZROK_VERSION=${{ env.ZROK_VERSION }}
# push: true
# - name: Set Up Container Image Tags for zrok Share Container
# env:
# RELEASE_REPO: openziti/zrok-share
# ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
# id: tagprep_share
# run: |
# DOCKER_TAGS=""
# DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest"
# echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
# echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
# - name: Build & Push Multi-Platform zrok Share Container Image to Hub
# uses: docker/build-push-action@v3
# with:
# builder: ${{ steps.buildx.outputs.name }}
# context: ${{ github.workspace }}/docker/images/zrok-share/
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.tagprep_share.outputs.DOCKER_TAGS }}
# build-args: |
# ZROK_VERSION=${{ env.ZROK_VERSION }}
# push: true
# - name: Set Up Container Image Tags for zrok Access Container
# env:
# RELEASE_REPO: openziti/zrok-access
# ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }}
# id: tagprep_access
# run: |
# DOCKER_TAGS=""
# DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest"
# echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}"
# echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT
# - name: Build & Push Multi-Platform zrok Access Container Image to Hub
# uses: docker/build-push-action@v3
# with:
# builder: ${{ steps.buildx.outputs.name }}
# context: ${{ github.workspace }}/docker/images/zrok-access/
# platforms: linux/amd64,linux/arm64
# tags: ${{ steps.tagprep_access.outputs.DOCKER_TAGS }}
# build-args: |
# ZROK_VERSION=${{ env.ZROK_VERSION }}
# push: true

View File

@ -9,6 +9,11 @@ on:
permissions:
contents: write
env:
ZITI_DEB_PROD_REPO: ${{ vars.ZITI_DEB_PROD_REPO || 'zitipax-openziti-deb-stable' }}
ZITI_RPM_PROD_REPO: ${{ vars.ZITI_RPM_PROD_REPO || 'zitipax-openziti-rpm-stable' }}
JFROG_CLI_VERSION: ${{ vars.JFROG_CLI_VERSION || '2.50.4' }}
jobs:
build-linux-amd64:
runs-on: ubuntu-20.04
@ -39,7 +44,7 @@ jobs:
env:
CI: "true"
- uses: goreleaser/goreleaser-action@v2
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
@ -52,6 +57,34 @@ jobs:
name: release-builds
path: ./dist/*.gz
- name: Configure jFrog CLI
uses: jfrog/setup-jfrog-cli@v3
with:
version: ${{ env.JFROG_CLI_VERSION }}
env:
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }}
- name: Upload RPM to Artifactory release repo
shell: bash
run: |
for RPM in ./dist/*.rpm; do
echo "INFO: Uploading $RPM"
jf rt upload --recursive=false --flat=true \
"$RPM" \
${{ env.ZITI_RPM_PROD_REPO }}/redhat/x86_64/
done
- name: Upload DEB to Artifactory release repo
shell: bash
run: >
for DEB in ./dist/*.deb; do
echo "INFO: Uploading $DEB"
jf rt upload --recursive=false --flat=true \
--deb=debian/main/amd64 \
"$DEB" \
${{ env.ZITI_DEB_PROD_REPO }}/pool/zrok/amd64/
done
build-linux-arm64:
runs-on: ubuntu-20.04
steps:
@ -94,6 +127,34 @@ jobs:
name: release-builds
path: ./dist/*.gz
- name: Configure jFrog CLI
uses: jfrog/setup-jfrog-cli@v3
with:
version: ${{ env.JFROG_CLI_VERSION }}
env:
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }}
- name: Upload RPM to Artifactory release repo
shell: bash
run: |
for RPM in ./dist/*.rpm; do
echo "INFO: Uploading $RPM"
jf rt upload --recursive=false --flat=true \
"$RPM" \
${{ env.ZITI_RPM_PROD_REPO }}/redhat/aarch64/
done
- name: Upload DEB to Artifactory release repo
shell: bash
run: >
for DEB in ./dist/*.deb; do
echo "INFO: Uploading $DEB"
jf rt upload --recursive=false --flat=true \
--deb=debian/main/arm64 \
"$DEB" \
${{ env.ZITI_DEB_PROD_REPO }}/pool/zrok/arm64/
done
build-linux-arm:
runs-on: ubuntu-20.04
steps:
@ -136,7 +197,36 @@ jobs:
name: release-builds
path: ./dist/*.gz
- name: Configure jFrog CLI
uses: jfrog/setup-jfrog-cli@v3
with:
version: ${{ env.JFROG_CLI_VERSION }}
env:
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }}
- name: Upload RPM to Artifactory release repo
shell: bash
run: |
for RPM in ./dist/*.rpm; do
echo "INFO: Uploading $RPM"
jf rt upload --recursive=false --flat=true \
"$RPM" \
${{ env.ZITI_RPM_PROD_REPO }}/redhat/armv7/
done
- name: Upload DEB to Artifactory release repo
shell: bash
run: >
for DEB in ./dist/*.deb; do
echo "INFO: Uploading $DEB"
jf rt upload --recursive=false --flat=true \
--deb=debian/main/armv7 \
"$DEB" \
${{ env.ZITI_DEB_PROD_REPO }}/pool/zrok/armv7/
done
build-darwin:
if: github.repository_owner == 'openziti' || vars.ZROK_SKIP_MACOS_BUILD == 'false'
runs-on: macos-latest
steps:
- name: import distribution cert
@ -188,6 +278,7 @@ jobs:
path: ./dist/*.gz
build-windows:
if: github.repository_owner == 'openziti' || vars.ZROK_SKIP_WINDOWS_BUILD == 'false'
runs-on: ubuntu-latest
steps:
- run: sudo apt update
@ -230,6 +321,9 @@ jobs:
path: ./dist/*.gz
publish-release:
# run even when a needed job was skipped, e.g. while Ken is testing in a fork where Windows and macOS
# are skipped
if: ${{ !cancelled() }}
needs: [build-linux-amd64, build-linux-arm, build-linux-arm64, build-darwin, build-windows]
runs-on: ubuntu-latest
steps:

View File

@ -13,3 +13,47 @@ builds:
- arm64
goarm:
- 8
nfpms:
- package_name: zrok
id: zrok-cli
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |-
zrok is a next-generation sharing platform, designed to make sharing network and file resources simple and
secure.
license: Apache 2.0
# Build IDs for the builds you want to create NFPM packages for.
builds:
- zrok-armv8
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
bindir: /opt/openziti/bin
# Contents to add to the package.
contents:
- src: /opt/openziti/bin/zrok
dst: /usr/bin/zrok
type: "symlink"

View File

@ -12,4 +12,48 @@ builds:
goarch:
- arm
goarm:
- 7
- 7
nfpms:
- package_name: zrok
id: zrok-cli
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |-
zrok is a next-generation sharing platform, designed to make sharing network and file resources simple and
secure.
license: Apache 2.0
# Build IDs for the builds you want to create NFPM packages for.
builds:
- zrok-armv7
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
bindir: /opt/openziti/bin
# Contents to add to the package.
contents:
- src: /opt/openziti/bin/zrok
dst: /usr/bin/zrok
type: "symlink"

View File

@ -1,5 +1,6 @@
builds:
- main: ./cmd/zrok
- id: zrok-amd64
main: ./cmd/zrok
binary: zrok
ldflags: "-s -w -X github.com/openziti/zrok/build.Version={{.Tag}} -X github.com/openziti/zrok/build.Hash={{.ShortCommit}}"
env:
@ -8,3 +9,47 @@ builds:
- linux
goarch:
- amd64
nfpms:
- package_name: zrok
id: zrok-cli
vendor: NetFoundry
homepage: https://zrok.io/
maintainer: support@zrok.io
description: |-
zrok is a next-generation sharing platform, designed to make sharing network and file resources simple and
secure.
license: Apache 2.0
# Build IDs for the builds you want to create NFPM packages for.
builds:
- zrok-amd64
# Formats to be generated.
formats:
- deb
- rpm
# {{ .ConventionalFileName }} satisfies the RPM name convention.
file_name_template: "{{ .ConventionalFileName }}"
# Umask to be used on files without explicit mode set. (overridable)
umask: 0o002
# Package version within this release version.
release: 1
# Section.
section: default
# Priority.
priority: optional
# GoReleaser will automatically add the binaries here
bindir: /opt/openziti/bin
# Contents to add to the package.
contents:
- src: /opt/openziti/bin/zrok
dst: /usr/bin/zrok
type: "symlink"

View File

@ -4,7 +4,7 @@
FEATURE: `zrok` Drives "Phase 1" (`p1`) functionality included in this release. This includes new `--backend-mode drive`, which accepts a folder path as a target. A `drive` share can be mounted as a network drive on Windows, macOS, and Linux, allowing full read/write access from all applications on those systems (https://github.com/openziti/zrok/issues/218) Subsequent releases will address CLI use cases and provide further refinements to the overall approach.
FEATURE: Docker Compose project for a reserved public share in docker/compose/zrok-public-share-reserved/compose.yml is described in the [public share guide](https://docs.zrok.io/docs/guides/docker-share/docker_public_share_guide/).
FEATURE: Docker Compose project for a reserved public share in docker/compose/zrok-public-reserved/compose.yml is described in the [public share guide](https://docs.zrok.io/docs/guides/docker-share/docker_public_share_guide/).
## v0.4.13

View File

@ -5,7 +5,7 @@ FROM debian:bullseye-slim
#
ARG TARGETARCH
ARG golang_version=1.20
ARG golang_version=1.21.3
ARG go_distribution_file=go${golang_version}.linux-${TARGETARCH}.tar.gz
ARG go_path=/usr/share/go
ARG go_root=/usr/local/go