@bifravst/ci 1.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `hello.nrfcloud.com` CI [![npm version](https://img.shields.io/npm/v/@bifravst/ci.svg)](https://www.npmjs.com/package/@bifravst/ci)
1
+ # Bifravst CI [![npm version](https://img.shields.io/npm/v/@bifravst/ci.svg)](https://www.npmjs.com/package/@bifravst/ci)
2
2
 
3
3
  [![GitHub Actions](https://github.com/bifravst/ci/workflows/Test%20and%20Release/badge.svg)](https://github.com/bifravst/ci/actions/workflows/test-and-release.yaml)
4
4
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
@@ -0,0 +1,12 @@
1
+ import { aws_iam as IAM } from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ export declare class ContinuousDeployment extends Construct {
4
+ readonly role: IAM.IRole;
5
+ constructor(parent: Construct, { repository: { owner, repo }, gitHubOICDProviderArn, }: {
6
+ repository: {
7
+ owner: string;
8
+ repo: string;
9
+ };
10
+ gitHubOICDProviderArn: string;
11
+ });
12
+ }
@@ -0,0 +1,23 @@
1
+ import { Duration, aws_iam as IAM, Stack } from 'aws-cdk-lib';
2
+ import { Construct } from 'constructs';
3
+ export class ContinuousDeployment extends Construct {
4
+ role;
5
+ constructor(parent, { repository: { owner, repo }, gitHubOICDProviderArn, }) {
6
+ super(parent, 'cd');
7
+ const gitHubOIDC = IAM.OpenIdConnectProvider.fromOpenIdConnectProviderArn(this, 'gitHubOICDProvider', gitHubOICDProviderArn);
8
+ this.role = new IAM.Role(this, 'ghRole', {
9
+ roleName: `${Stack.of(this).stackName}-cd`,
10
+ assumedBy: new IAM.WebIdentityPrincipal(gitHubOIDC.openIdConnectProviderArn, {
11
+ StringEquals: {
12
+ [`token.actions.githubusercontent.com:sub`]: `repo:${owner}/${repo}:environment:production`,
13
+ [`token.actions.githubusercontent.com:aud`]: 'sts.amazonaws.com',
14
+ },
15
+ }),
16
+ description: `This role is used by GitHub Actions to deploy ${Stack.of(this).stackName}`,
17
+ maxSessionDuration: Duration.hours(1),
18
+ managedPolicies: [
19
+ IAM.ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'),
20
+ ],
21
+ });
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ContinuousDeployment.js';
2
+ export * from './RepoPermission.js';
3
+ export * from './ensureGitHubOIDCProvider.js';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './ContinuousDeployment.js';
2
+ export * from './RepoPermission.js';
3
+ export * from './ensureGitHubOIDCProvider.js';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bifravst/ci",
3
- "version": "1.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Sets up the permissions in our CI account for all repositories in this account to be able to use it for CI runs.",
5
5
  "exports": {
6
- "./*": {
6
+ ".": {
7
7
  "import": {
8
- "types": "./dist/*.d.ts",
9
- "default": "./dist/*.js"
8
+ "types": "./dist/index.d.ts",
9
+ "default": "./dist/index.js"
10
10
  }
11
11
  }
12
12
  },
@@ -34,14 +34,14 @@
34
34
  "author": "Nordic Semiconductor ASA | nordicsemi.no",
35
35
  "license": "BSD-3-Clause",
36
36
  "devDependencies": {
37
- "@bifravst/eslint-config-typescript": "6.0.19",
37
+ "@bifravst/eslint-config-typescript": "6.0.22",
38
38
  "@bifravst/prettier-config": "1.0.0",
39
39
  "@commitlint/config-conventional": "19.1.0",
40
40
  "@nordicsemiconductor/from-env": "3.0.1",
41
41
  "@octokit/rest": "20.1.0",
42
- "aws-cdk": "2.135.0",
43
- "aws-cdk-lib": "2.135.0",
44
- "cdk": "2.135.0",
42
+ "aws-cdk": "2.137.0",
43
+ "aws-cdk-lib": "2.137.0",
44
+ "cdk": "2.137.0",
45
45
  "check-node-version": "4.2.1",
46
46
  "commitlint": "19.2.1",
47
47
  "constructs": "10.3.0",
@@ -95,7 +95,7 @@
95
95
  ],
96
96
  "prettier": "@bifravst/prettier-config",
97
97
  "peerDependencies": {
98
- "@aws-sdk/client-iam": "^3.549.0",
98
+ "@aws-sdk/client-iam": "^3.552.0",
99
99
  "chalk": "^5.3.0"
100
100
  }
101
101
  }