Skip to content

Commit eafa293

Browse files
authored
SImplify readme (#15)
1 parent 6aa753a commit eafa293

File tree

2 files changed

+79
-74
lines changed

2 files changed

+79
-74
lines changed

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing to Fly Action
2+
3+
Thank you for your interest in contributing to Fly Action! This guide will help you get started with development, testing, and publishing.
4+
5+
## Development Setup
6+
7+
To develop and test locally:
8+
9+
1. Clone the repository.
10+
2. Install dependencies: `npm install` (this also runs Prettier via the `postinstall` hook).
11+
3. Build: `npm run build` (this formats, type-checks TypeScript with `tsc`, and bundles the TypeScript source files into JavaScript for the action using `ncc`).
12+
4. Run tests: `npm test`.
13+
14+
> A Husky pre-commit hook is configured—any `git commit` will trigger `npm run build` to ensure your code is formatted, compiled, and bundled before committing.
15+
16+
## Build Process
17+
18+
The action is built using `npm run build`. This command formats the code with Prettier, performs type checking using TypeScript (`tsc`), and then compiles and bundles `src/index.ts` and `src/post.ts` into single executable JavaScript files: `lib/index.js` and `lib/post.js`. These `lib/` files are what the GitHub Action executes.
19+
20+
A Husky pre-commit hook is configured to run `npm run build` automatically on each commit, ensuring that code is formatted, type-checked, and bundled before being committed.
21+
22+
## Testing
23+
24+
### Unit Tests
25+
26+
Run the unit tests with:
27+
28+
```bash
29+
npm test
30+
```
31+
32+
### Integration Tests
33+
34+
Integration tests run automatically on pushes to the main branch, but require a valid Fly test server to be configured. The integration test will only run if the `FLY_TEST_URL` repository variable is set.
35+
36+
To configure integration testing:
37+
38+
1. Set up a Fly server that supports the required API endpoints
39+
2. Set the `FLY_TEST_URL` repository variable in your GitHub repository settings
40+
3. The integration test will automatically run on the next push
41+
42+
## Publishing a New Version
43+
44+
- Ensure tests pass and build is up to date:
45+
46+
```bash
47+
npm test && npm run build
48+
```
49+
50+
- Push changes to the default branch (e.g., `main`):
51+
52+
```bash
53+
git push origin main
54+
```
55+
56+
- Draft a release in the GitHub UI:
57+
1. Go to the "Releases" page of your repository.
58+
2. Click **Draft a new release**.
59+
3. Set the tag name to `vX.Y.Z` (e.g., `v1.2.3`).
60+
4. Publish the release.
61+
62+
Once the release is published, the GitHub Actions workflow will:
63+
64+
1. Extract the version from the tag (`vX.Y.Z`).
65+
2. Bump `package.json` and `package-lock.json` to `X.Y.Z`.
66+
3. Commit and push the updated lockfile.
67+
4. Update and force-push the `vX.Y` and `vX` tags.
68+
5. Push all changes back to the repository.
69+

README.md

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
# Fly Action
44

55
[![Scanned by Frogbot](https://raw.githubusercontent.com/jfrog/frogbot/refs/heads/master/images/frogbot-badge.svg)](https://docs.jfrog-applications.jfrog.io/jfrog-applications/frogbot)
6+
[![docs](https://img.shields.io/badge/Docs-%F0%9F%93%96-blue)](https://docs.fly.jfrog.ai)
67

78
</div>
89

910
This GitHub Action downloads the Fly CLI and configures package managers to use Fly as a registry for dependencies.
1011

12+
For more information about JFrog Fly, see the [official documentation](https://docs.fly.jfrog.ai).
13+
1114
## Features
1215

1316
- ✅ Supports all package managers available in Fly CLI
@@ -42,7 +45,7 @@ jobs:
4245

4346
### OIDC Authentication (Required)
4447

45-
This action only supports OIDC authentication for enhanced security. You must set `permissions: id-token: write` in your workflow file.
48+
This action requires OIDC authentication. The OIDC token is used to track uploads and downloads on the Fly server. You must set `permissions: id-token: write` in your workflow file.
4649

4750
```yaml
4851
permissions:
@@ -69,27 +72,15 @@ permissions:
6972

7073
When using OIDC authentication:
7174

72-
1. Your Fly server must support the OpenID Connect protocol and have a provider configured
73-
2. You need to set `permissions: id-token: write` in your workflow file
74-
3. The provider name is fixed to `fly-action`
75-
4. The action will:
75+
1. You need to set `permissions: id-token: write` in your workflow file
76+
2. The action will:
7677
- Request an OIDC token from GitHub Actions
77-
- Exchange it for a Fly access token via the `/fly/api/v1/ci/start-oidc` endpoint
78+
- Exchange it for a Fly access token
7879
- Use the resulting token to authenticate with Fly
79-
- Automatically notify CI session end via the `/fly/api/v1/ci/end` endpoint when the job completes (using GitHub Actions post-job mechanism)
80+
- Automatically notify the Fly server when the CI session ends (using GitHub Actions post-job mechanism)
8081

8182
> **Note**: The CI end notification runs automatically as a post-job step. This ensures it executes even if the main action fails, for proper session management on the Fly server. If the CI end notification step itself encounters an error, it will cause the overall workflow to be marked as failed.
8283

83-
### Fly Server Configuration for OIDC
84-
85-
To use OIDC authentication, your Fly server must be configured with:
86-
87-
1. An OIDC provider that accepts GitHub Actions tokens
88-
2. Custom Fly API endpoints:
89-
- `/fly/api/v1/ci/start-oidc` for token exchange and CI session initialization
90-
- `/fly/api/v1/ci/end` for CI session end notification
91-
3. Custom audience claim support (if using non-default audience)
92-
9384
## Supported Package Managers
9485

9586
The action supports all package managers that the Fly CLI supports:
@@ -103,64 +94,9 @@ The action supports all package managers that the Fly CLI supports:
10394
- **gradle** – Gradle build tool
10495
- **maven** – Maven build tool
10596

106-
## Testing
107-
108-
### Integration Tests
109-
110-
Integration tests run automatically on pushes to the main branch, but require a valid Fly test server to be configured. The integration test will only run if the `FLY_TEST_URL` repository variable is set.
111-
112-
To configure integration testing:
113-
114-
1. Set up a Fly server that supports the required API endpoints
115-
2. Set the `FLY_TEST_URL` repository variable in your GitHub repository settings
116-
3. The integration test will automatically run on the next push
117-
118-
## Build Process
119-
120-
The action is built using `npm run build`. This command formats the code with Prettier, performs type checking using TypeScript (`tsc`), and then compiles and bundles `src/index.ts` and `src/post.ts` into single executable JavaScript files: `lib/index.js` and `lib/post.js`. These `lib/` files are what the GitHub Action executes.
121-
122-
A Husky pre-commit hook is configured to run `npm run build` automatically on each commit, ensuring that code is formatted, type-checked, and bundled before being committed.
123-
124-
## Building and Publishing
125-
126-
### Development Setup
127-
128-
To develop and test locally:
129-
130-
1. Clone the repository.
131-
2. Install dependencies: `npm install` (this also runs Prettier via the `postinstall` hook).
132-
3. Build: `npm run build` (this formats, type-checks TypeScript with `tsc`, and bundles the TypeScript source files into JavaScript for the action using `ncc`).
133-
4. Run tests: `npm test`.
134-
135-
> A Husky pre-commit hook is configured—any `git commit` will trigger `npm run build` to ensure your code is formatted, compiled, and bundled before committing.
136-
137-
### Publishing a new version
138-
139-
- Ensure tests pass and build is up to date:
140-
141-
```bash
142-
npm test && npm run build
143-
```
144-
145-
- Push changes to the default branch (e.g., `main`):
146-
147-
```bash
148-
git push origin main
149-
```
150-
151-
- Draft a release in the GitHub UI:
152-
1. Go to the “Releases” page of your repository.
153-
2. Click **Draft a new release**.
154-
3. Set the tag name to `vX.Y.Z` (e.g., `v1.2.3`).
155-
4. Publish the release.
156-
157-
Once the release is published, the GitHub Actions workflow will:
97+
## Contributing
15898

159-
1. Extract the version from the tag (`vX.Y.Z`).
160-
2. Bump `package.json` and `package-lock.json` to `X.Y.Z`.
161-
3. Commit and push the updated lockfile.
162-
4. Update and force-push the `vX.Y` and `vX` tags.
163-
5. Push all changes back to the repository.
99+
See [CONTRIBUTING.md](CONTRIBUTING.md) for information on development setup, testing, and publishing.
164100

165101
## License
166102

0 commit comments

Comments
 (0)