Skip to content

Commit cb343b8

Browse files
fix: add verbose logging on failures
1 parent 29f2cea commit cb343b8

File tree

14 files changed

+2968
-805
lines changed

14 files changed

+2968
-805
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Release"
1+
name: 'Release'
22
permissions:
33
contents: write
44
id-token: write
@@ -8,17 +8,17 @@ on:
88
types: [published]
99
push:
1010
tags:
11-
- "v*"
11+
- 'v*'
1212
jobs:
1313
release:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: "Create Release"
16+
- name: 'Create Release'
1717
uses: actions/create-release@v1
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020
with:
2121
tag_name: ${{ github.ref }}
2222
release_name: Release ${{ github.ref }}
2323
draft: false
24-
prerelease: false
24+
prerelease: false

.github/workflows/test_install.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "🚀 Test Cloudsmith CLI Installer"
1+
name: '🚀 Test Cloudsmith CLI Installer'
22
on:
33
workflow_dispatch:
44
push:
@@ -18,33 +18,33 @@ jobs:
1818
auth-method: [oidc, api-key]
1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: "Set up Node.js"
21+
- name: 'Set up Node.js'
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: "20"
25-
- name: "Install dependencies"
24+
node-version: '20'
25+
- name: 'Install dependencies'
2626
run: npm install
27-
- name: "Build project"
27+
- name: 'Build project'
2828
run: npm run build
29-
- name: "📦 Run Cloudsmith CLI Installer"
29+
- name: '📦 Run Cloudsmith CLI Installer'
3030
uses: ./
3131
with:
32-
api-user-agent: "gha-test"
32+
api-user-agent: 'gha-test'
3333
oidc-namespace: ${{ matrix.auth-method == 'oidc' && vars.NAMESPACE || '' }}
3434
oidc-service-slug: ${{ matrix.auth-method == 'oidc' && vars.SERVICE_ACCOUNT || '' }}
3535
pip-install: ${{ matrix.install-method == 'pip' }}
3636
api-key: ${{ matrix.auth-method == 'api-key' && secrets.CLOUDSMITH_API_KEY || '' }}
37-
- name: "🔍 Verify Cloudsmith CLI Authentication (Linux and macOS)"
37+
- name: '🔍 Verify Cloudsmith CLI Authentication (Linux and macOS)'
3838
if: runner.os != 'Windows'
3939
run: |
4040
cloudsmith whoami
4141
shell: bash
42-
- name: "🔍 Verify Cloudsmith CLI Authentication (Windows)"
42+
- name: '🔍 Verify Cloudsmith CLI Authentication (Windows)'
4343
if: runner.os == 'Windows'
4444
run: |
4545
cloudsmith whoami
4646
shell: cmd
47-
- name: "📄 Read Config File (Linux and macOS)"
47+
- name: '📄 Read Config File (Linux and macOS)'
4848
if: runner.os != 'Windows'
4949
run: |
5050
CONFIG_FILE="$HOME/.cloudsmith/config.ini"
@@ -55,7 +55,7 @@ jobs:
5555
echo "Config file not found at $CONFIG_FILE"
5656
fi
5757
shell: bash
58-
- name: "📄 Read Config File (Windows)"
58+
- name: '📄 Read Config File (Windows)'
5959
if: runner.os == 'Windows'
6060
run: |
6161
$configFile = "$env:LOCALAPPDATA\cloudsmith\config.ini"
@@ -74,25 +74,25 @@ jobs:
7474
runs-on: ubuntu-latest
7575
steps:
7676
- uses: actions/checkout@v4
77-
78-
- name: "Set up Node.js"
77+
78+
- name: 'Set up Node.js'
7979
uses: actions/setup-node@v4
8080
with:
81-
node-version: "20"
82-
83-
- name: "Install dependencies"
81+
node-version: '20'
82+
83+
- name: 'Install dependencies'
8484
run: npm install
85-
86-
- name: "Build project"
85+
86+
- name: 'Build project'
8787
run: npm run build
88-
88+
8989
- name: OIDC Authentication Only
9090
uses: ./
9191
with:
9292
oidc-namespace: ${{ vars.NAMESPACE }}
9393
oidc-service-slug: ${{ vars.SERVICE_ACCOUNT }}
9494
oidc-auth-only: 'true'
95-
95+
9696
- name: Test Authentication
9797
run: |
9898
curl -X GET \
@@ -104,7 +104,7 @@ jobs:
104104
id: cli-test
105105
continue-on-error: true
106106
run: cloudsmith --version
107-
107+
108108
- name: Verify CLI installation failed
109109
if: steps.cli-test.outcome == 'success'
110110
run: |

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

CONTRIBUTION.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,57 @@
11
Thank you for considering contributing to the Cloudsmith CLI Install Action! Here are the steps to create a Pull Request (PR) and the necessary variables and secrets for GitHub Actions.
2+
23
## How to Create PRs (Fork)
4+
35
### Fork the Repository:
6+
47
- Navigate to the Cloudsmith CLI Install Action repository.
58
- Click the "Fork" button at the top right of the page.
69

710
### Clone Your Fork:
11+
812
- Open your terminal and clone your forked repository:
913

1014
```
1115
git clone <your-forked-repo-url>
1216
```
1317

1418
### Create a New Branch:
19+
1520
- Create a new branch for your feature or bug fix:
1621

1722
```
1823
git checkout -b <branch-name>
1924
```
2025

2126
### Make Your Changes:
27+
2228
- Make the necessary changes in your local repository.
2329

2430
### Commit Your Changes:
31+
2532
- Commit your changes with a descriptive message:
2633

2734
```
2835
git commit -m "Your commit message"
2936
```
3037

3138
### Push Your Changes:
39+
3240
- Push your changes to your forked repository:
3341

3442
```
3543
git push origin <branch-name>
3644
```
3745

3846
### Create a Pull Request:
47+
3948
- Navigate to your forked repository on GitHub.
4049
- Click the "Compare & pull request" button.
4150
- Provide a descriptive title and detailed description of your changes.
4251
- Click "Create pull request".
4352

4453
## Running Locally
54+
4555
To run this project locally, you need to have Node.js and npm installed. Follow these steps:
4656

4757
- Install the dependencies:
@@ -60,39 +70,45 @@ npm run build
6070
- Configure the variables below and trigger the test action.
6171

6272
## Variables and Secrets for GitHub Actions
73+
6374
To run the GitHub Actions workflows, you need to set up the following variables and secrets in your repository:
6475

6576
### Variables:
77+
6678
- NAMESPACE: Your Cloudsmith OIDC namespace.
6779
- SERVICE_ACCOUNT: Your Cloudsmith OIDC service account slug.
6880

6981
### Secrets:
82+
7083
- CLOUDSMITH_API_KEY: Your Cloudsmith API key.
7184

7285
To add these variables and secrets:
7386

7487
1. Navigate to Your Repository Settings:
75-
- Go to your repository on GitHub.
76-
- Click on "Settings".
88+
89+
- Go to your repository on GitHub.
90+
- Click on "Settings".
7791

7892
2. Add Variables:
79-
- Go to "Secrets and variables" > "Actions" > "Variables".
80-
- Click "New repository variable" and add NAMESPACE and SERVICE_ACCOUNT.
93+
94+
- Go to "Secrets and variables" > "Actions" > "Variables".
95+
- Click "New repository variable" and add NAMESPACE and SERVICE_ACCOUNT.
8196

8297
3. Add Secrets:
83-
- Go to "Secrets and variables" > "Actions" > "Secrets".
84-
- Click "New repository secret" and add CLOUDSMITH_API_KEY.
98+
- Go to "Secrets and variables" > "Actions" > "Secrets".
99+
- Click "New repository secret" and add CLOUDSMITH_API_KEY.
85100

86101
## Example Commands/Code to Change
102+
87103
Here is an example of how you might modify the [`test_install.yml`](".github/workflows/test_install.yml") workflow to use a different CLI version and authentication method:
88104

89105
```yaml
90106
- name: Install Cloudsmith CLI
91107
uses: cloudsmith-io/cloudsmith-cli-action@v1
92108
with:
93-
cli-version: 1.3.0
94-
auth-method: token
95-
token: ${{ secrets.CLOUDSMITH_API_KEY }}
109+
cli-version: 1.3.0
110+
auth-method: token
111+
token: ${{ secrets.CLOUDSMITH_API_KEY }}
96112
```
97113
98114
You can modify other inputs similarly based on your requirements.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ with:
5656
```
5757
5858
This will:
59+
5960
- Perform OIDC authentication
6061
- Set the OIDC token as `CLOUDSMITH_API_KEY` environment variable
6162
- Skip CLI installation
@@ -64,7 +65,6 @@ This will:
6465

6566
Full CLI feature list can be found [here](https://github.com/cloudsmith-io/cloudsmith-cli?tab=readme-ov-file#features) 📖
6667

67-
6868
### Publish a package
6969

7070
For all supported package formats and upload commands please visit our [Supported Formats](https://docs.cloudsmith.com/formats) page. 📦
@@ -97,6 +97,7 @@ jobs:
9797
run: |
9898
cloudsmith push python your-namespace/your-repository dist/*.tar.gz
9999
```
100+
100101
## Contribution
101102

102103
Please check our [CONTRIBUTION](CONTRIBUTION.md) doc for more information. 🤝
@@ -108,4 +109,3 @@ This project is licensed under the MIT License - see the LICENSE file for detail
108109
## Support
109110

110111
If you have any questions or need further assistance, please open an issue on GitHub. We're here to help! 💬 Alternatively, you can contact us at [support.cloudsmith.com](https://support.cloudsmith.com/).
111-

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Set up Cloudsmith CLI in GitHub Actions
33
author: BartoszBlizniak
44
inputs:
55
cli-version:
6-
description: "A specific version of the Cloudsmith CLI is installed/used."
6+
description: 'A specific version of the Cloudsmith CLI is installed/used.'
77
default: ''
88
required: false
99
api-key:
@@ -50,12 +50,12 @@ inputs:
5050
default: ''
5151
required: false
5252
outputs:
53-
oidc-token:
54-
description: "JWT token generated by the Cloudsmith CLI setup action"
53+
oidc-token:
54+
description: 'JWT token generated by the Cloudsmith CLI setup action'
5555
runs:
5656
using: 'node20'
57-
main: "dist/index.js"
57+
main: 'dist/index.js'
5858

5959
branding:
6060
icon: 'box'
61-
color: 'blue'
61+
color: 'blue'

0 commit comments

Comments
 (0)