|
|
|
|
@ -42,8 +42,6 @@ jobs:
|
|
|
|
|
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
|
|
|
|
|
with:
|
|
|
|
|
go-version: ${{ inputs.go-version }}
|
|
|
|
|
- name: Determine artifact basename
|
|
|
|
|
run: echo "ARTIFACT_BASENAME=${{ inputs.package-name }}_${{ inputs.product-version }}_${{ inputs.goos }}_${{ inputs.goarch }}.zip" >> $GITHUB_ENV
|
|
|
|
|
- name: Build Terraform
|
|
|
|
|
env:
|
|
|
|
|
GOOS: ${{ inputs.goos }}
|
|
|
|
|
@ -51,7 +49,7 @@ jobs:
|
|
|
|
|
GO_LDFLAGS: ${{ inputs.ld-flags }}
|
|
|
|
|
ACTIONSOS: ${{ inputs.runson }}
|
|
|
|
|
CGO_ENABLED: ${{ inputs.cgo-enabled }}
|
|
|
|
|
uses: hashicorp/actions-go-build@v0.1.7
|
|
|
|
|
uses: hashicorp/actions-go-build@e20c6be7bf010e40e930dab20e6da63176725ec1 # v0.1.9
|
|
|
|
|
with:
|
|
|
|
|
product_name: ${{ inputs.package-name }}
|
|
|
|
|
product_version: ${{ inputs.product-version }}
|
|
|
|
|
@ -60,15 +58,14 @@ jobs:
|
|
|
|
|
arch: ${{ inputs.goarch }}
|
|
|
|
|
reproducible: nope
|
|
|
|
|
instructions: |-
|
|
|
|
|
mkdir dist out
|
|
|
|
|
set -x
|
|
|
|
|
go build -ldflags "${{ inputs.ld-flags }}" -o dist/ .
|
|
|
|
|
zip -r -j out/${{ env.ARTIFACT_BASENAME }} dist/
|
|
|
|
|
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
|
|
|
|
with:
|
|
|
|
|
name: ${{ env.ARTIFACT_BASENAME }}
|
|
|
|
|
path: out/${{ env.ARTIFACT_BASENAME }}
|
|
|
|
|
if-no-files-found: error
|
|
|
|
|
go build -ldflags "${{ inputs.ld-flags }}" -o "$BIN_PATH" -trimpath -buildvcs=false
|
|
|
|
|
cp LICENSE "$TARGET_DIR/LICENSE.txt"
|
|
|
|
|
- name: Copy license file to config_dir
|
|
|
|
|
if: ${{ matrix.goos == 'linux' }}
|
|
|
|
|
env:
|
|
|
|
|
LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ inputs.package-name }}"
|
|
|
|
|
run: |
|
|
|
|
|
mkdir -p "$LICENSE_DIR" && cp LICENSE "$LICENSE_DIR/LICENSE.txt"
|
|
|
|
|
- if: ${{ inputs.goos == 'linux' }}
|
|
|
|
|
uses: hashicorp/actions-packaging-linux@v1
|
|
|
|
|
with:
|
|
|
|
|
@ -82,6 +79,7 @@ jobs:
|
|
|
|
|
binary: "dist/terraform"
|
|
|
|
|
deb_depends: "git"
|
|
|
|
|
rpm_depends: "git"
|
|
|
|
|
config_dir: ".release/linux/package/"
|
|
|
|
|
- if: ${{ inputs.goos == 'linux' }}
|
|
|
|
|
name: Determine package file names
|
|
|
|
|
run: |
|
|
|
|
|
|