Skip to content

Commit 2b95d9b

Browse files
authored
Merge pull request #1463 from valadas/npm-trusted-publishing
Migrated to npm Trusted Publishing
2 parents 1a80ce3 + ec836e6 commit 2b95d9b

7 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/Deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ on:
2525
tags:
2626
- 'v*'
2727

28+
permissions:
29+
id-token: write
30+
contents: read
31+
2832
jobs:
2933
ubuntu-latest:
3034
name: ubuntu-latest
@@ -37,4 +41,3 @@ jobs:
3741
run: ./build.cmd Deploy
3842
env:
3943
GithubToken: ${{ secrets.GITHUB_TOKEN }}
40-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

_build/Build.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@
3737
[GitHubActions(
3838
"Deploy",
3939
GitHubActionsImage.UbuntuLatest,
40-
ImportSecrets = new[] { nameof(GithubToken), "NPM_TOKEN" },
40+
ImportSecrets = new[] { nameof(GithubToken) },
4141
OnPushBranches = new[] { "main", "master", "release/*" },
4242
OnPushTags = new[] { "v*" },
4343
InvokedTargets = new[] { nameof(Deploy) },
4444
FetchDepth = 0,
45-
CacheKeyFiles = new string[] {}
45+
CacheKeyFiles = new string[] {},
46+
WritePermissions = new[] { GitHubActionsPermissions.IdToken },
47+
ReadPermissions = new[] { GitHubActionsPermissions.Contents }
4648
)]
4749
[GitHubActions(
4850
"Publish_Site",
@@ -263,9 +265,6 @@ class Build : NukeBuild
263265
.DependsOn(TagRelease)
264266
.DependsOn(Release)
265267
.Executes(() => {
266-
var npmToken = Environment.GetEnvironmentVariable("NPM_TOKEN");
267-
var npmrcFile = RootDirectory / ".npmrc";
268-
npmrcFile.WriteAllText($"//registry.npmjs.org/:_authToken={npmToken}");
269268
var tag = gitRepository.IsOnMainOrMasterBranch() ? "latest" : "next";
270269
Npm($"publish --access public --tag {tag} --workspaces");
271270
});

_build/_build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageDownload Include="GitVersion.Tool" Version="[5.11.1]" />
18+
<PackageDownload Include="GitVersion.Tool" Version="[6.6.0]" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dnncommunity/dnn-elements-react",
3-
"version": "0.28.0-alpha.330",
3+
"version": "0.28.0-nuke-10.1",
44
"description": "Dnn themed custom elements with react wrappers.",
55
"homepage": "https://github.com/dnncommunity/dnn-elements",
66
"license": "MIT",

packages/stencil-library/licenses.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"@dnncommunity/dnn-elements@0.28.0-alpha.330": {
2+
"@dnncommunity/dnn-elements@0.28.0-nuke-10.1": {
33
"licenses": "MIT",
44
"repository": "https://github.com/dnncommunity/dnn-elements",
55
"path": "",

packages/stencil-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dnncommunity/dnn-elements",
3-
"version": "0.28.0-alpha.330",
3+
"version": "0.28.0-nuke-10.1",
44
"description": "Dnn themed custom elements.",
55
"repository": "https://github.com/dnncommunity/dnn-elements",
66
"homepage": "https://dnncommunity.github.io/dnn-elements",

0 commit comments

Comments
 (0)