-
Notifications
You must be signed in to change notification settings - Fork 16
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 #449 from openziti/linux-package
add linux package
- Loading branch information
Showing
5 changed files
with
205 additions
and
15 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,162 @@ | ||
name: Publish Linux Packages | ||
|
||
on: | ||
push: | ||
tags: | ||
# Publish semver tags as releases. | ||
- app-ziti-console-v*.*.* | ||
|
||
jobs: | ||
parse-version: | ||
name: Find Console Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.parse.outputs.version }} | ||
steps: | ||
- name: Checkout Workspace | ||
uses: actions/checkout@v4 | ||
|
||
- name: Derive version from tag or package | ||
id: parse | ||
shell: bash | ||
env: | ||
GITHUB_REF_NAME: ${{ github.ref_name }} | ||
GITHUB_RUN_ID: ${{ github.run_id }} | ||
run: | | ||
set -o pipefail | ||
echo "version=${GITHUB_REF_NAME#app-ziti-console-v}" | tee -a $GITHUB_OUTPUT | ||
build-and-upload-app-ziti-console: | ||
needs: parse-version | ||
name: Build Console ZIP | ||
runs-on: ubuntu-latest | ||
env: | ||
BUILD_CONFIG: "Release" | ||
steps: | ||
- name: Checkout Workspace | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
registry-url: https://npm.pkg.github.com/ | ||
|
||
- name: build app-ziti-console | ||
shell: bash | ||
run: ./build.sh /zac/ | ||
|
||
- name: upload app-ziti-console | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: app-ziti-console | ||
path: ./dist/app-ziti-console/ | ||
|
||
publish-linux-packages: | ||
needs: | ||
- parse-version | ||
- build-and-upload-app-ziti-console | ||
name: ${{ matrix.package_name }} ${{ matrix.arch.rpm }} ${{ matrix.nfpm_packager }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
package_name: | ||
- openziti-console | ||
arch: | ||
- goreleaser: amd64 | ||
deb: amd64 | ||
rpm: x86_64 | ||
- goreleaser: arm64 | ||
deb: arm64 | ||
rpm: aarch64 | ||
- goreleaser: armv7 | ||
deb: armv7 | ||
rpm: armv7 | ||
nfpm_packager: | ||
- rpm | ||
- deb | ||
# - archlinux # (pacman) | ||
env: | ||
ZAC_VERSION: ${{ needs.parse-version.outputs.version }} | ||
ZITI_MAINTAINER: "OpenZiti Maintainers <[email protected]>" | ||
ZITI_HOMEPAGE: "https://openziti.io" | ||
ZITI_VENDOR: "NetFoundry, Inc." | ||
GOARCH: ${{ matrix.arch.goreleaser }} | ||
ZITI_DEB_TEST_REPO: ${{ vars.ZITI_DEB_TEST_REPO || 'zitipax-openziti-deb-test' }} | ||
ZITI_RPM_TEST_REPO: ${{ vars.ZITI_RPM_TEST_REPO || 'zitipax-openziti-rpm-test' }} | ||
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' }} | ||
NFPM_VERSION: "2.38.0" | ||
JFROG_CLI_VERSION: "2.63.0" | ||
steps: | ||
- name: Checkout Workspace | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download app-ziti-console | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: app-ziti-console | ||
path: ./dist/app-ziti-console | ||
|
||
- name: Build Package | ||
id: nfpm | ||
uses: burningalchemist/action-gh-nfpm@eeac96f42da23d091eec0d0088bf05cac0ceb9f3 | ||
with: | ||
nfpm_version: ${{ env.NFPM_VERSION }} | ||
packager: ${{ matrix.nfpm_packager }} | ||
config: ./linux-packages/openziti-console/nfpm-${{ matrix.package_name }}.yaml | ||
target: ./dist/ | ||
|
||
- name: upload package artifact to build summary page | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.package_name }}-${{ matrix.arch.goreleaser }}-${{ matrix.nfpm_packager }} | ||
path: ./dist/${{ matrix.package_name }}*.${{ matrix.nfpm_packager }} | ||
if-no-files-found: error | ||
|
||
- name: Configure jFrog CLI | ||
uses: jfrog/setup-jfrog-cli@v4 | ||
env: | ||
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }} | ||
with: | ||
version: ${{ env.JFROG_CLI_VERSION }} | ||
|
||
- name: Upload RPM to Artifactory testing repo | ||
if: matrix.nfpm_packager == 'rpm' | ||
shell: bash | ||
run: > | ||
jf rt upload | ||
./dist/${{ matrix.package_name }}*.rpm | ||
${{ env.ZITI_RPM_TEST_REPO }}/redhat/${{ matrix.arch.rpm }}/ | ||
--recursive=false | ||
--flat=true | ||
- name: Upload DEB to Artifactory testing repo | ||
if: matrix.nfpm_packager == 'deb' | ||
shell: bash | ||
run: > | ||
jf rt upload | ||
./dist/${{ matrix.package_name }}*.deb | ||
${{ env.ZITI_DEB_TEST_REPO }}/pool/${{ matrix.package_name }}/${{ matrix.arch.deb }}/ | ||
--deb=debian/main/${{ matrix.arch.deb }} | ||
--recursive=false | ||
--flat=true | ||
- name: Copy DEB from test repo to stable repo with jFrog CLI | ||
if: matrix.nfpm_packager == 'deb' | ||
shell: bash | ||
run: > | ||
jf rt copy | ||
--recursive=false | ||
--flat=true | ||
${{ env.ZITI_DEB_TEST_REPO }}/pool/${{ matrix.package_name }}/${{ matrix.arch.deb }}/${{ matrix.package_name }}_${{ needs.parse-version.outputs.version }}_*.deb | ||
${{ env.ZITI_DEB_PROD_REPO }}/pool/${{ matrix.package_name }}/${{ matrix.arch.deb }}/ | ||
- name: Copy RPM from test repo to stable repo with jFrog CLI | ||
if: matrix.nfpm_packager == 'rpm' | ||
shell: bash | ||
run: > | ||
jf rt copy | ||
--recursive=false | ||
--flat=true | ||
${{ env.ZITI_RPM_TEST_REPO }}/redhat/${{ matrix.arch.rpm }}/${{ matrix.package_name }}-${{ needs.parse-version.outputs.version }}-*.${{ matrix.arch.rpm }}.rpm | ||
${{ env.ZITI_RPM_PROD_REPO }}/redhat/${{ matrix.arch.rpm }}/ |
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 |
---|---|---|
@@ -1,4 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
if ! (( $# )) | ||
then | ||
echo "usage: $0 <base-href>" | ||
exit 1 | ||
fi | ||
|
||
npm install | ||
npm install -g @angular/[email protected] | ||
ng build ziti-console-lib | ||
ng build ziti-console --base-href $1 --deploy-url $1 --configuration "production" | ||
# WARN: deployUrl deprecated since Angular 13, pending decommission in future ng CLI | ||
ng build ziti-console --base-href "$1" --deploy-url "$1" --configuration "production" |
16 changes: 16 additions & 0 deletions
16
linux-packages/openziti-console/nfpm-openziti-console.yaml
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,16 @@ | ||
# nfpm configuration file | ||
# | ||
# check https://nfpm.goreleaser.com/configuration for detailed usage | ||
# | ||
name: openziti-console | ||
arch: ${GOARCH} | ||
platform: linux | ||
version: ${ZAC_VERSION} | ||
maintainer: ${ZITI_MAINTAINER} | ||
description: A single-page web application for managing an OpenZiti overlay network | ||
vendor: ${ZITI_VENDOR} | ||
homepage: ${ZITI_HOMEPAGE} | ||
license: Apache-2.0 | ||
contents: | ||
- dst: /opt/openziti/share/console | ||
src: ./dist/app-ziti-console |