terraform_cli: support path
and env
and in terraform_cli
blocks
#374
Workflow file for this run
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
name: PR_build | |
on: | |
# Runs when a pull request is created against main branch | |
pull_request: | |
branches: | |
- main | |
env: | |
PKG_NAME: "enos" | |
jobs: | |
build-artifact: | |
name: Build Linux Artifact | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux] | |
goarch: [amd64] | |
fail-fast: true | |
outputs: | |
artifact-name: ${{ steps.build.outputs.artifact-name }} | |
env: | |
GOPRIVATE: 'github.com/hashicorp/*' | |
TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }} | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
CI: true | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | |
with: | |
go-version-file: go.mod | |
- name: Get Product Version | |
id: get-product-version | |
run: | | |
make version | |
echo "product-version=$(make version)" >> "$GITHUB_OUTPUT" | |
- uses: ./.github/actions/build | |
id: build | |
with: | |
goarch: ${{ matrix.goarch }} | |
goos: ${{ matrix.goos }} | |
version: ${{ steps.get-product-version.outputs.product-version }} | |
- name: Upload | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: ${{ env.PKG_NAME }}_${{ steps.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | |
path: out/${{ env.PKG_NAME }}_${{ steps.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip | |
retention-days: 1 | |
validate-artifact: | |
name: Validate Artifact | |
needs: build-artifact | |
# Use local path to call reusable workflow validate.yml. | |
uses: ./.github/workflows/validate.yml | |
with: | |
artifact-name: ${{ needs.build-artifact.outputs.artifact-name }} | |
secrets: inherit |