Skip to content

Latest commit

 

History

History
84 lines (70 loc) · 3.16 KB

FLACONI.md

File metadata and controls

84 lines (70 loc) · 3.16 KB

Flaconi

This document describes the specifics required for maintaining our own GitHub provider until this PR has been merged: integrations#802 (by https://github.com/n0rad/terraform-provider-github)

Keep branches up-to-date

# Update our own code
git checkout main
git pull origin main
git checkout -b updates

# Update integrations/terraform-provider-github
git remote add integrations https://github.com/integrations/terraform-provider-github
git merge -S integrations/main

# Update PR 802
git remote add n0rad https://github.com/n0rad/terraform-provider-github
git merge -S n0rad/master

Build release artifacts

When creating a new GitHub release, use the same release name (and git tag) as integrations/terraform-provider-github is using for its latest. We're simply enhancing it with n0rad's addition and want to follow their version scheme.

  1. Delete latest tag from integrations/terraform-provider-github (we're overwriting it)
    git tag -d v4.19.0
    git push --delete origin  v4.19.0
  2. Create git tag with v[0-9]\.[0-9]\.[0-9] (e.g.: v4.19.0)
  3. Create a GitHub Release with name: v[0-9]\.[0-9]\.[0-9] (e.g.: v4.19.0)
  4. Create release/ directory
    mkdir release
  5. Build Linux artifacts:
    mkdir .cache
    docker run -it --rm --user $(id -u):$(id -g) -v $(pwd)/.cache:/.cache -v $(pwd):/data -v $(pwd)/release:/go/bin -w /data golang make fmt
    docker run -it --rm --user $(id -u):$(id -g) -v $(pwd)/.cache:/.cache -v $(pwd):/data -v $(pwd)/release:/go/bin -w /data golang make build
    mv release/terraform-provider-github release/terraform-provider-github_4.19.0_linux_amd64
  6. Build MacOS artifacts (requires to be on a Mac):
    make fmt
    make build
    cp /go/bin/terraform-provider-github release/terraform-provider-github_4.19.0_darwin_amd64
  7. Pack artifacts for release page
    # Enter release/ directory
    cd release
    
    # Make executable
    chmod +x *
    
    # Zip files
    zip terraform-provider-github_4.19.0_linux_amd64.zip terraform-provider-github_4.19.0_linux_amd64
    zip terraform-provider-github_4.19.0_darwin_amd64.zip terraform-provider-github_4.19.0_darwin_amd64
    
    # Create SHA256SUMS file
    shasum -a 256 terraform-provider-github_4.19.0_linux_amd64.zip > terraform-provider-github_4.19.0_SHA256SUMS
    shasum -a 256 terraform-provider-github_4.19.0_darwin_amd64.zip >> terraform-provider-github_4.19.0_SHA256SUMS
    
    # Create binary signature of SHA256SUMS file
    # Use the same gpg identity as uploaded in Terraform Registry account (`EB10297E7BD3F3AD`)
    gpg \
      --local-user EB10297E7BD3F3AD \
      --output terraform-provider-github_4.19.0_SHA256SUMS.sig \
      --detach-sign terraform-provider-github_4.19.0_SHA256SUMS
  8. Upload the following files into the GitHub release:
    • terraform-provider-github_4.19.0_linux_amd64.zip
    • terraform-provider-github_4.19.0_darwin_amd64.zip
    • terraform-provider-github_4.19.0_SHA256SUMS
    • terraform-provider-github_4.19.0_SHA256SUMS.sig
  9. Update provider at registry: https://registry.terraform.io/publish/provider/github/Flaconi/terraform-provider-github