Skip to content

Commit 53ac717

Browse files
authored
Improve README and advanced usage guide (#174)
1 parent cbc183b commit 53ac717

File tree

2 files changed

+31
-33
lines changed

2 files changed

+31
-33
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ jobs:
111111

112112
## License
113113

114-
The scripts and documentation in this project are released under the [MIT License](LICENSE)
114+
The scripts and documentation in this project are released under the [MIT License](LICENSE).
115115

116116
## Contributions
117117

118-
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
118+
Contributions are welcome! See [Contributor's Guide](CONTRIBUTING.md)

docs/advanced-usage.md

+29-31
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ jobs:
129129
```yaml
130130
jobs:
131131
build:
132-
133132
runs-on: ubuntu-latest
134133

135134
steps:
@@ -207,7 +206,7 @@ The two `settings.xml` files created from the above example look like the follow
207206
</settings>
208207
```
209208

210-
***NOTE***: The `settings.xml` file is created in the Actions $HOME/.m2 directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.
209+
***NOTE***: The `settings.xml` file is created in the Actions `$HOME/.m2` directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See [below](#apache-maven-with-a-settings-path) for using the `settings-path` to change your `settings.xml` file location.
211210

212211
If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false`
213212

@@ -234,68 +233,67 @@ If `gpg-private-key` input is provided, the private key will be written to a fil
234233

235234
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
236235

237-
## Publishing using Gradle
236+
## Apache Maven with a settings path
237+
238+
When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file.
239+
238240
```yaml
239241
jobs:
240-
241242
build:
242243
runs-on: ubuntu-latest
243244
244245
steps:
245246
- uses: actions/checkout@v2
246-
247-
- name: Set up JDK 11
247+
- name: Set up JDK 11 for Shared Runner
248248
uses: actions/setup-java@v2
249249
with:
250250
distribution: '<distribution>'
251251
java-version: '11'
252+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
253+
settings-path: ${{ github.workspace }} # location for the settings.xml file
252254
253-
- name: Build with Gradle
254-
run: gradle build
255+
- name: Build with Maven
256+
run: mvn -B package --file pom.xml
255257
256-
- name: Publish to GitHub Packages
257-
run: gradle publish
258+
- name: Publish to GitHub Packages Apache Maven
259+
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
258260
env:
259-
USERNAME: ${{ github.actor }}
260-
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
261+
GITHUB_TOKEN: ${{ github.token }}
261262
```
262263

263-
***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`.***
264-
265-
See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file.
266-
267-
## Apache Maven with a settings path
268-
269-
When using an Actions self-hosted runner with multiple shared runners the default `$HOME` directory can be shared by a number runners at the same time which could overwrite existing settings file. Setting the `settings-path` variable allows you to choose a unique location for your settings file.
270-
264+
## Publishing using Gradle
271265
```yaml
272266
jobs:
273-
build:
274267
268+
build:
275269
runs-on: ubuntu-latest
276270
277271
steps:
278272
- uses: actions/checkout@v2
279-
- name: Set up JDK 11 for Shared Runner
273+
274+
- name: Set up JDK 11
280275
uses: actions/setup-java@v2
281276
with:
282277
distribution: '<distribution>'
283278
java-version: '11'
284-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
285-
settings-path: ${{ github.workspace }} # location for the settings.xml file
286279
287-
- name: Build with Maven
288-
run: mvn -B package --file pom.xml
280+
- name: Build with Gradle
281+
run: gradle build
289282
290-
- name: Publish to GitHub Packages Apache Maven
291-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
283+
- name: Publish to GitHub Packages
284+
run: gradle publish
292285
env:
293-
GITHUB_TOKEN: ${{ github.token }}
286+
USERNAME: ${{ github.actor }}
287+
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
294288
```
295289

290+
***NOTE: The `USERNAME` and `PASSWORD` need to correspond to the credentials environment variables used in the publishing section of your `build.gradle`.***
291+
292+
See the help docs on [Publishing a Package with Gradle](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages#example-using-gradle-groovy-for-a-single-package-in-a-repository) for more information on the `build.gradle` configuration file.
293+
296294
## Hosted Tool Cache
297-
GitHub Hosted Runners have a tool cache that comes with some Java versions pre-installed. This tool cache helps speed up runs and tool setup by not requiring any new downloads. There is an environment variable called `RUNNER_TOOL_CACHE` on each runner that describes the location of this tools cache and this is where you can find the pre-installed versions of Java. `setup-java` works by taking a specific version of Java in this tool cache and adding it to PATH if the version, architecture and distribution match.
295+
GitHub Hosted Runners have a tool cache that comes with some Java versions pre-installed. This tool cache helps speed up runs and tool setup by not requiring any new downloads. There is an environment variable called `RUNNER_TOOL_CACHE` on each runner that describes the location of this tools cache and this is where you can find the pre-installed versions of Java. `setup-java` works by taking a specific version of Java in this tool cache and adding it to PATH if the version, architecture and distribution match.
298296

299297
Currently, LTS versions of Adopt OpenJDK (`adopt`) are cached on the GitHub Hosted Runners.
300298

301-
The tools cache gets updated on a weekly basis. For information regarding locally cached versions of Java on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments).
299+
The tools cache gets updated on a weekly basis. For information regarding locally cached versions of Java on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments).

0 commit comments

Comments
 (0)