Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update provider to 6.0.0 #7

Merged
merged 2 commits into from
Feb 28, 2024
Merged
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
29 changes: 24 additions & 5 deletions .github/workflows/flake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,30 @@ on:
- main

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
name: altf4llc-os
- uses: actions/checkout@v3
- run: cachix use altf4llc-os
- run: nix develop -c just check
- run: nix develop -c just cache-inputs
- run: nix develop -c just cache-shell

build:
needs:
- check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix flake check
- run: nix build --json --no-link --print-build-logs
- uses: DeterminateSystems/nix-installer-action@main
- uses: cachix/cachix-action@v12
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
name: altf4llc-os
- uses: actions/checkout@v4
- run: cachix use altf4llc-os
- run: nix develop -c just cache-build
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Terraform module which creates GitHub team resources.

| Name | Version |
|------|---------|
| <a name="requirement_github"></a> [github](#requirement\_github) | 5.41.0 |
| <a name="requirement_github"></a> [github](#requirement\_github) | 6.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_github"></a> [github](#provider\_github) | 5.41.0 |
| <a name="provider_github"></a> [github](#provider\_github) | 6.0.0 |

## Modules

Expand All @@ -22,8 +22,8 @@ No modules.

| Name | Type |
|------|------|
| [github_team.self](https://registry.terraform.io/providers/integrations/github/5.41.0/docs/resources/team) | resource |
| [github_team_membership.self](https://registry.terraform.io/providers/integrations/github/5.41.0/docs/resources/team_membership) | resource |
| [github_team.self](https://registry.terraform.io/providers/integrations/github/6.0.0/docs/resources/team) | resource |
| [github_team_membership.self](https://registry.terraform.io/providers/integrations/github/6.0.0/docs/resources/team_membership) | resource |

## Inputs

Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 45 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,61 @@

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

outputs = inputs@{ flake-parts, nixpkgs, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
terraform-github = pkgs.terraform-providers.mkProvider {
outputs = inputs @ {
flake-parts,
nixpkgs,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
self',
inputs',
pkgs,
system,
...
}: let
inherit (pkgs) just terraform-docs;
terraform = pkgs.terraform.withPlugins (p: [
(pkgs.terraform-providers.mkProvider {
hash = "sha256-y8DMpNSySMbe7E+sGVQcQdEyulq4Wnp5ryYD7FQO/fc=";
homepage = "https://registry.terraform.io/providers/integrations/github";
owner = "integrations";
repo = "terraform-provider-github";
rev = "v5.41.0";
hash = "sha256-fWxWcHy3TWFEpkU9uDSsHbUu+dnQKfvquN63eZH+Qf0=";
rev = "v6.0.0";
vendorHash = null;
};
in
{
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
})
]);
in {
_module.args.pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};

packages = {
terraform-with-plugins = pkgs.terraform.withPlugins (ps: [
terraform-github
]);
devShells = {
default = pkgs.mkShell {
buildInputs = [
just
terraform
terraform-docs
];
};
};

default = pkgs.runCommand "default"
{
src = ./.;
} ''
packages = {
default =
pkgs.runCommand "default"
{
src = ./.;
} ''
mkdir -p $out
cp -R $src/*.tf $out

${config.packages.terraform-with-plugins}/bin/terraform -chdir="$out" init
${config.packages.terraform-with-plugins}/bin/terraform -chdir="$out" validate
${terraform}/bin/terraform -chdir="$out" init
${terraform}/bin/terraform -chdir="$out" validate
'';
};

devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [
terraform
terraform-docs
];
};
};
};
};
};
}
33 changes: 33 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
_default:
just --list

build:
nix build --json --no-link --print-build-logs

cache-build cache_name="altf4llc-os":
just build \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push {{ cache_name }}

cache-inputs cache_name="altf4llc-os":
nix flake archive --json \
| jq -r '.path,(.inputs|to_entries[].value.path)' \
| cachix push "{{ cache_name }}"

cache-shell cache_name="altf4llc-os":
nix develop --profile "dev-profile" -c true
cachix push "{{ cache_name }}" "dev-profile"

check:
nix flake check

docs:
terraform-docs markdown table \
--output-file README.md \
--output-mode inject .

init:
terraform init

validate:
terraform validate
2 changes: 1 addition & 1 deletion providers.tf → versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
github = {
source = "integrations/github"
version = "5.41.0"
version = "6.0.0"
}
}
}
Loading