Prepare for release v0.14.0 #306
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 | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to build, e.g. 0.1.0" | |
| type: string | |
| required: false | |
| env: | |
| PKG_NAME: "vault-lambda-extension" | |
| jobs: | |
| get-product-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| product-version: ${{ steps.get-product-version.outputs.product-version }} | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - name: get product version | |
| id: get-product-version | |
| run: | | |
| VERSION="${{ github.event.inputs.version || '0.0.0-dev' }}" | |
| echo "Using version ${VERSION}" | |
| echo "product-version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - name: Generate metadata file | |
| id: generate-metadata-file | |
| uses: hashicorp/actions-generate-metadata@v1 | |
| with: | |
| version: ${{ needs.get-product-version.outputs.product-version }} | |
| product: ${{ env.PKG_NAME }} | |
| repositoryOwner: "hashicorp" | |
| - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
| with: | |
| name: metadata.json | |
| path: ${{ steps.generate-metadata-file.outputs.filepath }} | |
| build: | |
| needs: | |
| - get-product-version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goos: [linux] | |
| goarch: ["arm64", "amd64"] | |
| fail-fast: true | |
| name: Go ${{ matrix.goos }} ${{ matrix.goarch }} build | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
| - name: Setup go | |
| uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
| with: | |
| go-version-file: .go-version | |
| - name: Build | |
| id: build-binary | |
| # these env vars are required for the make command to build for each arch | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| VERSION: ${{ needs.get-product-version.outputs.product-version }} | |
| run: | | |
| ZIP_FILE="${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip" | |
| make zip | |
| mv pkg/${{ env.PKG_NAME }}.zip pkg/"$ZIP_FILE" | |
| echo "name=${ZIP_FILE}" >> "$GITHUB_OUTPUT" | |
| echo "path=pkg/${ZIP_FILE}" >> "$GITHUB_OUTPUT" | |
| - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
| with: | |
| name: ${{ steps.build-binary.outputs.name }} | |
| path: ${{ steps.build-binary.outputs.path }} |