You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/advanced-usage.md
+29-31
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,6 @@ jobs:
129
129
```yaml
130
130
jobs:
131
131
build:
132
-
133
132
runs-on: ubuntu-latest
134
133
135
134
steps:
@@ -207,7 +206,7 @@ The two `settings.xml` files created from the above example look like the follow
207
206
</settings>
208
207
```
209
208
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.
211
210
212
211
If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false`
213
212
@@ -234,68 +233,67 @@ If `gpg-private-key` input is provided, the private key will be written to a fil
234
233
235
234
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.
236
235
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
+
238
240
```yaml
239
241
jobs:
240
-
241
242
build:
242
243
runs-on: ubuntu-latest
243
244
244
245
steps:
245
246
- uses: actions/checkout@v2
246
-
247
-
- name: Set up JDK 11
247
+
- name: Set up JDK 11 for Shared Runner
248
248
uses: actions/setup-java@v2
249
249
with:
250
250
distribution: '<distribution>'
251
251
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
252
254
253
-
- name: Build with Gradle
254
-
run: gradle build
255
+
- name: Build with Maven
256
+
run: mvn -B package --file pom.xml
255
257
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
258
260
env:
259
-
USERNAME: ${{ github.actor }}
260
-
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
261
+
GITHUB_TOKEN: ${{ github.token }}
261
262
```
262
263
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
271
265
```yaml
272
266
jobs:
273
-
build:
274
267
268
+
build:
275
269
runs-on: ubuntu-latest
276
270
277
271
steps:
278
272
- uses: actions/checkout@v2
279
-
- name: Set up JDK 11 for Shared Runner
273
+
274
+
- name: Set up JDK 11
280
275
uses: actions/setup-java@v2
281
276
with:
282
277
distribution: '<distribution>'
283
278
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
286
279
287
-
- name: Build with Maven
288
-
run: mvn -B package --file pom.xml
280
+
- name: Build with Gradle
281
+
run: gradle build
289
282
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
292
285
env:
293
-
GITHUB_TOKEN: ${{ github.token }}
286
+
USERNAME: ${{ github.actor }}
287
+
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
294
288
```
295
289
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
+
296
294
## 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.
298
296
299
297
Currently, LTS versions of Adopt OpenJDK (`adopt`) are cached on the GitHub Hosted Runners.
300
298
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