forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding CRT to main branch (hashicorp#13088)
* adding CRT to main branch * cleanup * um i dont know how that got removed but heres the fix * add vault.service Co-authored-by: Kyle Penfound <kpenfound11@gmail.com>
- Loading branch information
1 parent
928b50a
commit 1bec996
Showing
25 changed files
with
796 additions
and
6,380 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,242 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/heads | ||
branches: | ||
# Push events on main branch | ||
- main | ||
|
||
env: | ||
PKG_NAME: "vault" | ||
GO_TAGS: "ui" | ||
|
||
jobs: | ||
get-product-version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
product-version: ${{ steps.get-product-version.outputs.product-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: get product version | ||
id: get-product-version | ||
run: | | ||
make version | ||
echo "::set-output name=product-version::$(make version)" | ||
generate-metadata-file: | ||
needs: get-product-version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
filepath: ${{ steps.generate-metadata-file.outputs.filepath }} | ||
steps: | ||
- name: 'Checkout directory' | ||
uses: actions/checkout@v2 | ||
- name: Generate metadata file | ||
id: generate-metadata-file | ||
uses: hashicorp/actions-generate-metadata@main | ||
with: | ||
version: ${{ needs.get-product-version.outputs.product-version }} | ||
product: ${{ env.PKG_NAME }} | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: metadata.json | ||
path: ${{ steps.generate-metadata-file.outputs.filepath }} | ||
|
||
build-other: | ||
needs: get-product-version | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [ freebsd, windows, netbsd, openbsd, solaris ] | ||
goarch: [ "386", "amd64", "arm" ] | ||
go: [ "1.17.2" ] | ||
exclude: | ||
- goos: solaris | ||
goarch: 386 | ||
- goos: solaris | ||
goarch: arm | ||
- goos: windows | ||
goarch: arm | ||
fail-fast: true | ||
|
||
name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Setup node and yarn | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
cache: 'yarn' | ||
cache-dependency-path: 'ui/yarn.lock' | ||
- name: UI Build | ||
run: | | ||
cd ui | ||
yarn install --ignore-optional | ||
npm rebuild node-sass | ||
yarn --verbose run build | ||
cd .. | ||
- name: Build | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
CGO_ENABLED: 0 | ||
run: | | ||
mkdir dist out | ||
VAULT_VERSION=${{ needs.get-product-version.outputs.product-version }} VAULT_COMMIT=${GITHUB_SHA} GO_TAGS="${{ env.GO_TAGS }}" make build | ||
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
path: out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
|
||
build-linux: | ||
needs: get-product-version | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [linux] | ||
goarch: ["arm", "arm64", "386", "amd64"] | ||
go: ["1.17.2"] | ||
fail-fast: true | ||
|
||
name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Setup node and yarn | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
cache: 'yarn' | ||
cache-dependency-path: 'ui/yarn.lock' | ||
- name: UI Build | ||
run: | | ||
cd ui | ||
yarn install --ignore-optional | ||
npm rebuild node-sass | ||
yarn --verbose run build | ||
cd .. | ||
- name: Build | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
CGO_ENABLED: 0 | ||
run: | | ||
mkdir dist out | ||
VAULT_VERSION=${{ needs.get-product-version.outputs.product-version }} VAULT_COMMIT=${GITHUB_SHA} GO_TAGS="${{ env.GO_TAGS }}" make build | ||
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
path: out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
|
||
- name: Package | ||
uses: hashicorp/actions-packaging-linux@v1.2 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
description: "Vault is a tool for secrets management, encryption as a service, and privileged access management." | ||
arch: ${{ matrix.goarch }} | ||
version: ${{ needs.get-product-version.outputs.product-version }} | ||
maintainer: "HashiCorp" | ||
homepage: "https://github.com/hashicorp/vault" | ||
license: "MPL-2.0" | ||
binary: "dist/${{ env.PKG_NAME }}" | ||
deb_depends: "openssl" | ||
rpm_depends: "openssl" | ||
config_dir: ".release/linux/package/" | ||
preinstall: ".release/linux/preinst" | ||
postinstall: ".release/linux/postinst" | ||
postremove: ".release/linux/postrm" | ||
- name: Add Package names to env | ||
run: | | ||
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> $GITHUB_ENV | ||
echo "DEB_PACKAGE=$(basename out/*.deb)" >> $GITHUB_ENV | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.RPM_PACKAGE }} | ||
path: out/${{ env.RPM_PACKAGE }} | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.DEB_PACKAGE }} | ||
path: out/${{ env.DEB_PACKAGE }} | ||
|
||
build-darwin: | ||
needs: get-product-version | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
goos: [ darwin ] | ||
goarch: [ "amd64", "arm64" ] | ||
go: [ "1.17.2" ] | ||
fail-fast: true | ||
name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Setup node and yarn | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
cache: 'yarn' | ||
cache-dependency-path: 'ui/yarn.lock' | ||
- name: UI Build | ||
run: | | ||
cd ui | ||
yarn install --ignore-optional | ||
npm rebuild node-sass | ||
yarn --verbose run build | ||
cd .. | ||
- name: Build | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
CGO_ENABLED: 0 | ||
run: | | ||
mkdir dist out | ||
VAULT_VERSION=${{ needs.get-product-version.outputs.product-version }} VAULT_COMMIT=${GITHUB_SHA} GO_TAGS="${{ env.GO_TAGS }}" make build | ||
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/ | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
path: out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | ||
|
||
build-docker: | ||
name: Docker ${{ matrix.arch }} build | ||
needs: | ||
- get-product-version | ||
- build-linux | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: ["arm", "arm64", "386", "amd64"] | ||
env: | ||
repo: ${{github.event.repository.name}} | ||
version: ${{needs.get-product-version.outputs.product-version}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Docker Build (Action) | ||
uses: hashicorp/actions-docker-build@v1 | ||
with: | ||
version: ${{env.version}} | ||
target: default | ||
arch: ${{matrix.arch}} | ||
zip_artifact_name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip | ||
tags: | | ||
docker.io/hashicorp/${{env.repo}}:${{env.version}} | ||
ecr.public.aws/hashicorp/${{env.repo}}:${{env.version}} |
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
Oops, something went wrong.