Skip to content

Commit 13ee79e

Browse files
committed
⚙️ (jfrog): Disable github release
1 parent e339e77 commit 13ee79e

File tree

1 file changed

+53
-33
lines changed

1 file changed

+53
-33
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ on:
77

88
env:
99
FORCE_COLOR: "1"
10+
# NPM_REGISTRY: jfrog.ledgerlabs.net/artifactory/api/npm/ldk-npm-prod-public
11+
NPM_REGISTRY: jfrog.ledgerlabs.net/artifactory/api/npm/ldk-npm-sandbox-green
1012

1113
permissions:
1214
id-token: write
1315
contents: write
1416
pull-requests: write
17+
# Need to attest artifacts
18+
attestations: write
1519

1620
jobs:
1721
publish:
@@ -20,59 +24,75 @@ jobs:
2024
steps:
2125
- uses: actions/checkout@v4
2226

23-
- uses: ./.github/actions/setup-toolchain-composite
27+
# - uses: ./.github/actions/setup-toolchain-composite
2428

25-
- name: install dependencies
26-
run: pnpm install
29+
# - name: install dependencies
30+
# run: pnpm install
2731

28-
- name: build libraries
29-
run: pnpm build
32+
# - name: build libraries
33+
# run: pnpm build
3034

3135
- name: Login to internal JFrog registry
3236
id: jfrog-login
3337
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1
3438

3539
- name: Setup npm config for JFrog
3640
env:
37-
# NPM_REGISTRY: jfrog.ledgerlabs.net/artifactory/api/npm/ldk-npm-prod-public
38-
NPM_REGISTRY: jfrog.ledgerlabs.net/artifactory/api/npm/ldk-npm-sandbox-green
3941
NPM_REGISTRY_TOKEN: ${{ steps.jfrog-login.outputs.oidc-token }}
4042
run: |
4143
cat << EOF | tee .npmrc
4244
registry=https://${NPM_REGISTRY}/
4345
//${NPM_REGISTRY}/:_authToken=${NPM_REGISTRY_TOKEN}
4446
EOF
4547
46-
- name: Publish
47-
id: changesets
48-
uses: changesets/action@v1
49-
# to remove
50-
with:
51-
publish: pnpm release
52-
# to remove
53-
branch: feat/no-issue-jfrog-attest-sign-package
54-
env:
55-
GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
48+
# - name: Publish
49+
# id: changesets
50+
# uses: changesecahts/action@v1
51+
# with:
52+
# publish: pnpm release
53+
# # to remove
54+
# title: "⚙️ (release) [NO-ISSUE]: Version packages"
55+
# commit: "⚙️ (release): Version packages"
56+
# branch: feat/no-issue-jfrog-attest-sign-package
57+
# createGithubReleases: false
58+
# env:
59+
# GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
5660

5761
- name: Download published packages to attest and sign
5862
# if: steps.changesets.outputs.published == 'true'
63+
env:
64+
PUBLISHED_PACKAGE_JSON: published-packages.json
5965
run: |
60-
# Extract package name
61-
PACKAGE_NAME=${{ steps.changesets.outputs.publishedPackages }}
62-
63-
echo $PACKAGE_NAME
66+
# Extract packages name
67+
# output will be in the form of: [{"name":"@ledgerhq/package-name","version":"X.X.X"}]
68+
cat << EOF | tee $PUBLISHED_PACKAGE_JSON
69+
[{"name":"@ledgerhq/device-sdk-ts","version":"0.4.0"}]
70+
EOF
6471
65-
mkdir dist
72+
# Create dist directory
73+
mkdir -p dist
6674
67-
# - name: Attest tarball
68-
# if: steps.changesets.outputs.published == 'true'
69-
# uses: LedgerHQ/actions-security/actions/attest@actions/attest-1
70-
# with:
71-
# subject-path: ./dist
72-
# push-to-registry: true
75+
# Loop over package names and download the tarball into dist directory
76+
for row in $(cat $PUBLISHED_PACKAGE_JSON | jq -r '.[] | @text'); do
77+
PACKAGE_NAME=$(echo $row| jq -r '.name')
78+
PACKAGE_VERSION=$(echo $row | jq -r '.version')
79+
PACKAGE_NAME_BASENAME=$(basename ${PACKAGE_NAME})
7380
74-
# - name: Sign tarball
75-
# if: steps.changesets.outputs.published == 'true'
76-
# uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1
77-
# with:
78-
# path: ./dist
81+
echo -e "\033[0;32mDownload artifact from\033[0m https://${NPM_REGISTRY}/${PACKAGE_NAME}/-/${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz"
82+
curl -H "Authorization: Bearer ${{ steps.jfrog-login.outputs.oidc-token }}" \
83+
-o dist/${PACKAGE_NAME_BASENAME}-${PACKAGE_VERSION}.tgz \
84+
https://${NPM_REGISTRY}/${PACKAGE_NAME}/-/${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz
85+
done
86+
87+
- name: Attest tarball
88+
# if: steps.changesets.outputs.published == 'true'
89+
uses: actions/attest-build-provenance@v1
90+
with:
91+
subject-path: ./dist
92+
93+
# The action currently doesn't support pushing the blob to the registry
94+
- name: Sign tarball
95+
# if: steps.changesets.outputs.published == 'true'
96+
uses: LedgerHQ/actions-security/actions/sign-blob@actions/sign-blob-1
97+
with:
98+
path: ./dist

0 commit comments

Comments
 (0)