-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1244 from openziti/build-linux-packages
Build and publish linux package ziti-cli
- Loading branch information
Showing
6 changed files
with
183 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Publish Linux Packages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ziti-version: | ||
description: generated by 'ziti-ci get-current-version' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
publish-linux-packages: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package_name: | ||
- ziti-cli | ||
arch: | ||
- goreleaser: amd64 | ||
gox: amd64 | ||
deb: amd64 | ||
rpm: x86_64 | ||
- goreleaser: arm64 | ||
gox: arm64 | ||
deb: arm64 | ||
rpm: aarch64 | ||
- goreleaser: armv7 | ||
gox: arm | ||
deb: armv7 | ||
rpm: armv7 | ||
nfpm_packager: | ||
- rpm | ||
- deb | ||
# - archlinux # (pacman) | ||
# - apk | ||
env: | ||
ZITI_VERSION: ${{ inputs.ziti-version || github.event.inputs.ziti-version }} | ||
ZITI_MAINTAINER: "OpenZiti Maintainers <[email protected]>" | ||
ZITI_HOMEPAGE: "https://openziti.io" | ||
ZITI_VENDOR: "NetFoundry" | ||
GOARCH: ${{ matrix.arch.goreleaser }} | ||
steps: | ||
- name: Checkout Workspace | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download Linux Release Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: linux-release-${{ github.run_id }} | ||
path: release/ | ||
|
||
- name: Move Release Artifact for Architecture to Predictable Location for nfpm | ||
run: | | ||
mv -v ./release/${{ matrix.arch.gox }}/linux/ziti \ | ||
./release/ziti | ||
- name: Build Package | ||
id: nfpm | ||
uses: burningalchemist/action-gh-nfpm@v1 | ||
# uses: netfoundry/action-gh-nfpm@main | ||
with: | ||
nfpm_version: "2.32.0" | ||
packager: ${{ matrix.nfpm_packager }} | ||
config: build/dist-packages/linux/nfpm-${{ matrix.package_name }}.yaml | ||
target: release/ | ||
|
||
- name: get the package name from the output | ||
run: echo ${{ steps.nfpm.outputs.package }} | ||
shell: bash | ||
|
||
- run: ls -lh release/ | ||
|
||
- name: upload package artifact to build summary page | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.package_name }}-${{ matrix.arch.goreleaser }}-${{ matrix.nfpm_packager }} | ||
path: ./release/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
if-no-files-found: error | ||
|
||
- name: Configure jFrog CLI | ||
uses: jfrog/setup-jfrog-cli@v3 | ||
env: | ||
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }} | ||
|
||
- name: Upload RPM to Artifactory testing repo | ||
if: ${{ !github.event.release.published && matrix.nfpm_packager == 'rpm' }} | ||
run: > | ||
jf rt upload | ||
./release/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
/zitipax-openziti-rpm-stable/testing/${{ matrix.arch.rpm }}/ | ||
--recursive=false | ||
--flat=true | ||
- name: Upload RPM to Artifactory release repo | ||
if: ${{ github.event.release.published && matrix.nfpm_packager == 'rpm' }} | ||
run: > | ||
jf rt upload | ||
./release/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
/zitipax-openziti-rpm-stable/release/${{ matrix.arch.rpm }}/ | ||
--recursive=false | ||
--flat=true | ||
- name: Upload DEB to Artifactory testing repo | ||
if: ${{ !github.event.release.published && matrix.nfpm_packager == 'deb' }} | ||
run: > | ||
jf rt upload | ||
./release/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
/zitipax-openziti-deb-stable/pool/${{ matrix.package_name }}/testing/${{ matrix.arch.deb }}/ | ||
--deb=testing/main/${{ matrix.arch.deb }} | ||
--recursive=false | ||
--flat=true | ||
- name: Upload DEB to Artifactory release repo | ||
if: ${{ github.event.release.published && matrix.nfpm_packager == 'deb' }} | ||
run: > | ||
jf rt upload | ||
./release/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
/zitipax-openziti-deb-stable/pool/${{ matrix.package_name }}/release/${{ matrix.arch.deb }}/ | ||
--deb=release/main/${{ matrix.arch.deb }} | ||
--recursive=false | ||
--flat=true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# nfpm-configs | ||
|
||
These are `nfpm` configuration files. `nfpm` generates Linux packages, e.g., | ||
RPM. These files reference environment variables set in GitHub Actions workflow | ||
`.github/workflows/publish-linux-install-packages.yml`. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# nfpm configuration file | ||
# | ||
# check https://nfpm.goreleaser.com/configuration for detailed usage | ||
# | ||
name: ziti-cli | ||
arch: ${GOARCH} | ||
platform: linux | ||
version: ${ZITI_VERSION} | ||
maintainer: ${ZITI_MAINTAINER} | ||
description: > | ||
The ziti-cli package provides the ziti executable binary as a command line | ||
interface for Ziti. | ||
vendor: ${ZITI_VENDOR} | ||
homepage: ${ZITI_HOMEPAGE} | ||
license: Apache-2.0 | ||
contents: | ||
- src: ./release/ziti | ||
dst: /opt/openziti/bin/ziti | ||
file_info: | ||
mode: 0755 | ||
- src: /opt/openziti/bin/ziti | ||
dst: /usr/bin/ziti | ||
type: symlink | ||
|
||
# packager-neutral scripts may be overriden by packager-specific scripts | ||
# scripts: | ||
# preinstall: ./scripts/preinstall.sh | ||
# postinstall: ./scripts/postinstall.sh | ||
# preremove: ./scripts/preremove.sh | ||
# postremove: ./scripts/postremove.sh |
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