IND-6310 - CRT Onboarding #16
Workflow file for this run
This file contains hidden or 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
| name: build | |
| # We now default to running this workflow on every push to every branch. | |
| # This provides fast feedback when build issues occur, so they can be | |
| # fixed prior to being merged to the main branch. | |
| # | |
| # If you want to opt out of this, and only run the build on certain branches | |
| # please refer to the documentation on branch filtering here: | |
| # | |
| # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore | |
| # | |
| on: [workflow_dispatch, push] | |
| env: | |
| PKG_NAME: "go-getter" | |
| jobs: | |
| get-go-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| go-version: ${{ steps.get-go-version.outputs.go-version }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Determine Go version | |
| id: get-go-version | |
| # We use .go-version as our source of truth for current Go | |
| # version, because "goenv" can react to it automatically. | |
| # Specify the exact Go version (e.g., 1.22.4) in .go-version | |
| # if your build requires a specific patch version of Go. | |
| # Otherwise, specify the major and minor versions (e.g., 1.22), | |
| # with a caveat that it can lead to builds using different | |
| # patch versions of Go in a workflow run. | |
| run: | | |
| echo "Building with Go $(cat .go-version)" | |
| echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT" | |
| set-product-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| product-version: ${{ steps.set-product-version.outputs.product-version }} | |
| product-base-version: ${{ steps.set-product-version.outputs.base-product-version }} | |
| product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }} | |
| product-minor-version: ${{ steps.set-product-version.outputs.minor-product-version }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set Product version | |
| id: set-product-version | |
| uses: hashicorp/actions-set-product-version@v1 | |
| generate-metadata-file: | |
| needs: set-product-version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| filepath: ${{ steps.generate-metadata-file.outputs.filepath }} | |
| steps: | |
| - name: "Checkout directory" | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Generate metadata file | |
| id: generate-metadata-file | |
| uses: hashicorp/actions-generate-metadata@v1 | |
| with: | |
| version: ${{ needs.set-product-version.outputs.product-version }} | |
| product: ${{ env.PKG_NAME }} | |
| repositoryOwner: "hashicorp" | |
| repository: ${{ github.event.repository.name }} | |
| - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| with: | |
| name: metadata.json | |
| path: ${{ steps.generate-metadata-file.outputs.filepath }} | |
| build-other: | |
| needs: | |
| - get-go-version | |
| - set-product-version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false # recommended during development | |
| matrix: | |
| goos: [freebsd, windows, netbsd, openbsd, solaris] | |
| goarch: ["386", "amd64", "arm"] | |
| go: [ "${{ needs.get-go-version.outputs.go-version }}" ] | |
| exclude: | |
| - goos: solaris | |
| goarch: 386 | |
| - goos: solaris | |
| goarch: arm | |
| - goos: windows | |
| goarch: arm | |
| name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hashicorp/actions-go-build@v1 | |
| env: | |
| BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }} | |
| PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}} | |
| METADATA_VERSION: ${{ env.METADATA }} | |
| with: | |
| product_name: ${{ env.PKG_NAME }} | |
| product_version: ${{ needs.set-product-version.outputs.product-version }} | |
| go_version: ${{ matrix.go }} | |
| os: ${{ matrix.goos }} | |
| arch: ${{ matrix.goarch }} | |
| reproducible: report | |
| instructions: |- | |
| cp LICENSE "$TARGET_DIR/LICENSE.txt" | |
| go build -o "$BIN_PATH" -trimpath -buildvcs=false | |
| build-linux: | |
| needs: | |
| - get-go-version | |
| - set-product-version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goos: [linux] | |
| goarch: ["arm", "arm64", "386", "amd64"] | |
| fail-fast: false # recommended during development | |
| name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hashicorp/actions-go-build@v1 | |
| env: | |
| BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }} | |
| PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}} | |
| METADATA_VERSION: ${{ env.METADATA }} | |
| with: | |
| product_name: ${{ env.PKG_NAME }} | |
| product_version: ${{ needs.set-product-version.outputs.product-version }} | |
| go_version: ${{ needs.get-go-version.outputs.go-version }} | |
| os: ${{ matrix.goos }} | |
| arch: ${{ matrix.goarch }} | |
| reproducible: report | |
| instructions: | | |
| cp LICENSE "$TARGET_DIR/LICENSE.txt" | |
| go build -o "$BIN_PATH" -trimpath -buildvcs=false | |
| - name: Copy license file to config_dir | |
| if: ${{ matrix.goos == 'linux' }} | |
| 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 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| description: "go-getter is a Go library and command line tool for downloading files and directories from various sources including local filesystems, HTTP(S), Git, Mercurial, Amazon S3, Google Cloud Storage, and Azure Blob Storage." | |
| arch: ${{ matrix.goarch }} | |
| version: ${{ needs.set-product-version.outputs.product-version }} | |
| maintainer: "HashiCorp" | |
| homepage: "https://github.com/hashicorp/go-getter" | |
| license: "MPL-2.0" | |
| binary: "dist/${{ env.PKG_NAME }}" | |
| deb_depends: "openssl" | |
| rpm_depends: "openssl" | |
| config_dir: ".release/linux/package/" | |
| - name: Set Package Names | |
| if: ${{ matrix.goos == 'linux' }} | |
| run: | | |
| echo "RPM_PACKAGE=$(basename out/*.rpm)" >> "$GITHUB_ENV" | |
| echo "DEB_PACKAGE=$(basename out/*.deb)" >> "$GITHUB_ENV" | |
| - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| if: ${{ matrix.goos == 'linux' }} | |
| with: | |
| name: ${{ env.RPM_PACKAGE }} | |
| path: out/${{ env.RPM_PACKAGE }} | |
| - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
| if: ${{ matrix.goos == 'linux' }} | |
| with: | |
| name: ${{ env.DEB_PACKAGE }} | |
| path: out/${{ env.DEB_PACKAGE }} | |
| build-darwin: | |
| needs: | |
| - get-go-version | |
| - set-product-version | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| goos: [darwin] | |
| goarch: ["amd64", "arm64"] | |
| fail-fast: true | |
| name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: hashicorp/actions-go-build@v1 | |
| env: | |
| BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }} | |
| PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}} | |
| METADATA_VERSION: ${{ env.METADATA }} | |
| with: | |
| product_name: ${{ env.PKG_NAME }} | |
| product_version: ${{ needs.set-product-version.outputs.product-version }} | |
| go_version: ${{ needs.get-go-version.outputs.go-version }} | |
| os: ${{ matrix.goos }} | |
| arch: ${{ matrix.goarch }} | |
| reproducible: report | |
| instructions: | | |
| cp LICENSE "$TARGET_DIR/LICENSE.txt" | |
| go build -o "$BIN_PATH" -trimpath -buildvcs=false | |