Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/labeler-issue-triage.yaml

This file was deleted.

97 changes: 0 additions & 97 deletions .github/labeler-pull-request-triage.yaml

This file was deleted.

176 changes: 20 additions & 156 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,168 +21,32 @@ env:
PKG_NAME: "terraform-provider-azuread"

jobs:
# Detects the Go toolchain version to use for product builds.
#
# The implementation is inspired by envconsul -- https://go.hashi.co/get-go-version-example
get-go-version:
name: "Detect Go toolchain version"
goreleaser:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
go-version-file: 'go.mod'
- name: Detect Go version
id: get-go-version
run: |
version="$(go list -f {{.GoVersion}} -m)"
echo "go-version=$version" >> "$GITHUB_OUTPUT"

# Parses the version/VERSION file. Reference: https://github.com/hashicorp/actions-set-product-version/blob/main/README.md
#
# > This action should be implemented in product repo `build.yml` files. The action is intended to grab the version
# > from the version file at the beginning of the build, then passes those versions (along with metadata, where
# > necessary) to any workflow jobs that need version information.
set-product-version:
name: "Parse version file"
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 variables
id: set-product-version
uses: hashicorp/actions-set-product-version@v2

# Creates metadata.json file containing build metadata for consumption by CRT workflows.
#
# Reference: https://github.com/hashicorp/actions-generate-metadata/blob/main/README.md
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"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: metadata.json
path: ${{ steps.generate-metadata-file.outputs.filepath }}

# Uploads an Actions artifact named terraform-registry-manifest.json.zip.
#
# The artifact contains a single file with a filename that Terraform Registry expects
# (example: terraform-provider-crt-example_2.3.6-alpha1_manifest.json). The file contents
# are identical to the terraform-registry-manifest.json file in the source repository.
upload-terraform-registry-manifest-artifact:
needs: set-product-version
runs-on: ubuntu-latest
steps:
- name: "Checkout directory"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ env.PKG_NAME }}
- name: "Copy manifest from checkout directory to a file with the desired name"
id: terraform-registry-manifest
run: |
name="${{ env.PKG_NAME }}"
version="${{ needs.set-product-version.outputs.product-version }}"
ref: main
fetch-depth: 0

source="${name}/terraform-registry-manifest.json"
destination="${name}_${version}_manifest.json"

cp "$source" "$destination"
echo "filename=$destination" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
# Install Tools
- name: Install aqua
uses: aquaproj/aqua-installer@d1fe50798dbadd4eb5b98957290ca175f6b4870f # v4.0.2
with:
name: terraform-registry-manifest.json
path: ${{ steps.terraform-registry-manifest.outputs.filename }}
if-no-files-found: error

# Builds the product for all platforms except macOS.
#
# With `reproducible: report`, this job also reports whether the build is reproducible,
# but does not enforce it.
#
# Reference: https://github.com/hashicorp/actions-go-build/blob/main/README.md
build:
needs:
- get-go-version
- set-product-version
runs-on: ubuntu-latest
strategy:
fail-fast: true
# TODO: Customize `matrix` for your provider. Compare to existing .goreleaser.yml.
# Verify expected Artifacts list for a workflow run.
matrix:
goos: [freebsd, windows, linux, darwin]
goarch: ["386", "amd64", "arm", "arm64"]
exclude:
- goos: darwin
goarch: arm
- goos: darwin
goarch: "386"
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm64
- 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
aqua_version: v2.53.4
env:
CGO_ENABLED: 0
BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }}
PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}}
METADATA_VERSION: ${{ env.METADATA }}
AQUA_GITHUB_TOKEN: ${{github.token}} # include token to prevent GitHub rate limit

- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
# Protocol v6 providers should omit the `_x5` suffix.
bin_name: "${{ env.PKG_NAME }}_v${{ needs.set-product-version.outputs.product-version }}_x5"
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: |
go build \
-o "$BIN_PATH" \
-trimpath \
-buildvcs=false \
-ldflags "-s -w -X 'main.version=${{ needs.set-product-version.outputs.product-version }}'"
cp LICENSE "$TARGET_DIR/LICENSE.txt"
go-version-file: 'go.mod'

whats-next:
needs:
- build
- generate-metadata-file
- upload-terraform-registry-manifest-artifact
runs-on: ubuntu-latest
name: "What's next?"
steps:
- name: "Write a helpful summary"
- name: Run GoReleaser
run: |
github_dot_com="${{ github.server_url }}"
owner_with_name="${{ github.repository }}"
ref="${{ github.ref }}"

echo "### What's next?" >> "$GITHUB_STEP_SUMMARY"
echo "#### For a release branch (see \`.release/ci.hcl\`)" >> $GITHUB_STEP_SUMMARY
echo "After this \`build\` workflow run completes succesfully, you can expect the CRT \`prepare\` workflow to begin momentarily." >> "$GITHUB_STEP_SUMMARY"
echo "To find the \`prepare\` workflow run, [view the checks for this commit]($github_dot_com/$owner_with_name/commits/$ref)" >> "$GITHUB_STEP_SUMMARY"
goreleaser release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_FLAG_LATEST: "true"
RELEASE_FLAG_PRERELEASE: "true"
4 changes: 2 additions & 2 deletions .github/workflows/golint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
save-artifacts-on-fail:
needs: golint
if: ${{ failure() }}
uses: hashicorp/terraform-provider-azuread/.github/workflows/save-artifacts.yaml@latest
uses: glueckkanja/terraform-provider-azuread/.github/workflows/save-artifacts.yaml@latest

comment-on-fail:
needs: golint
if: ${{ failure() }}
uses: hashicorp/terraform-provider-azuread/.github/workflows/comment-failure.yaml@latest
uses: glueckkanja/terraform-provider-azuread/.github/workflows/comment-failure.yaml@latest
23 changes: 0 additions & 23 deletions .github/workflows/increment-milestone.yaml

This file was deleted.

Loading