Skip to content

Commit

Permalink
add license file
Browse files Browse the repository at this point in the history
  • Loading branch information
xwa153 committed May 28, 2024
1 parent 4a5c7b0 commit 7f79d52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
CGO_ENABLED: 0
run: |
mkdir dist out
cp LICENSE dist/LICENSE.txt
go build -o dist/ -ldflags "-s -w -X $(go list -m)/version.GitCommit=$(git rev-parse --short HEAD)" .
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
CGO_ENABLED: 0
run: |
mkdir dist out
cp LICENSE dist/LICENSE.txt
go build -o dist/ -ldflags "-s -w -X $(go list -m)/version.GitCommit=$(git rev-parse --short HEAD)" .
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/
Expand All @@ -145,6 +147,13 @@ jobs:
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: Copy license file
env:
LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ env.PKG_NAME }}"
run: |
mkdir -p "$LICENSE_DIR"
cp LICENSE "$LICENSE_DIR/LICENSE.txt"
- name: Package
if: ${{ matrix.goos == 'linux' }}
uses: hashicorp/actions-packaging-linux@v1
Expand All @@ -159,6 +168,7 @@ jobs:
binary: "dist/${{ env.PKG_NAME }}"
deb_depends: "openssl"
rpm_depends: "openssl"
config_dir: ".release/linux/package"

- name: Set Package Names
if: ${{ matrix.goos == 'linux' }}
Expand Down Expand Up @@ -206,6 +216,7 @@ jobs:
- name: Build
run: |
mkdir dist out
cp LICENSE dist/LICENSE.txt
go build -tags netcgo -o dist/
zip -r -j out/${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip dist/
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ ARG PRODUCT_REVISION
ARG PRODUCT_NAME=$BIN_NAME
# TARGETARCH and TARGETOS are set automatically when --platform is provided.
ARG TARGETOS TARGETARCH
ENV PRODUCT_NAME=$BIN_NAME

LABEL maintainer="Consul Team <[email protected]>"
# version label is required for build process
LABEL version=$PRODUCT_VERSION
LABEL revision=$PRODUCT_REVISION
LABEL licenses="MPL-2.0"

# These are the defaults, this makes them explicit and overridable.
ARG UID=100
Expand All @@ -31,6 +33,7 @@ RUN addgroup -g ${GID} ${BIN_NAME} \

# where the build system stores the builds
COPY ./dist/$TARGETOS/$TARGETARCH/$BIN_NAME /bin/
COPY LICENSE /usr/share/doc/$PRODUCT_NAME/LICENSE.txt

# entrypoint
COPY ./.release/docker-entrypoint.sh /bin/
Expand Down

0 comments on commit 7f79d52

Please sign in to comment.