Skip to content

Commit

Permalink
📝Update lockfile snippet for each version automatic (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: MartinWitt <[email protected]>
  • Loading branch information
MartinWitt and MartinWitt authored Apr 11, 2023
1 parent 46d8a15 commit 21038b8
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
maven-version: 3.9.0
- name: Generate Readme+action.yml
run: mvn resources:copy-resources -q
run: mvn generate-resources resources:copy-resources -q
- name: commit doc changes
uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b # v9
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Set release version
run: mvn --no-transfer-progress --batch-mode versions:set -DnewVersion=$NEXT_VERSION -DprocessAllModules
- name: Generate Readme
run : mvn resources:copy-resources
run : mvn generate-resources resources:copy-resources
- name: Commit & Push changes
uses: actions-js/push@master
with:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
# Time to update some files with the new version
#1 Readme and action.yml
- name: Generate Readme
run : mvn resources:copy-resources -q
run : mvn generate-resources resources:copy-resources -q
# Commit and push changes
- name: Commit & Push changes
uses: actions-js/push@master
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ Usage:
```yml
name: Lockfile
on:
pull_request:
pull_request:


jobs:
check-lockfile:
check-lockfile:
runs-on: ubuntu-latest
steps:
- name: run maven-lockfile
uses: chains-project/[email protected]
with:
uses: chains-project/maven-lockfile@20c49498ce30d0d6505ef97e8055c7cba90caa9f # v1.1.7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```
If a pom.xml file is changed this action will add a commit with the updated lockfile to the pull request.
Expand Down
23 changes: 23 additions & 0 deletions github_action/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,29 @@
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>2.1.0</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<configuration>
<scripts>
<script></script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
Expand Down
23 changes: 23 additions & 0 deletions maven_plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,29 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>2.1.0</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<configuration>
<scripts>
<script></script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@
</pom>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>2.1.0</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>4.0.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>execute</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<scripts>
<script>def file = new File(".github/workflows/Lockfile.yml")
project.properties.action_content = file.getText()</script>
</scripts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
14 changes: 1 addition & 13 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,7 @@ We have created a GithubAction that can be used to validate the integrity of you
A sample workflow is shown below:
Usage:
```yml
name: Lockfile
on:
pull_request:


jobs:
check-lockfile:
runs-on: ubuntu-latest
steps:
- name: run maven-lockfile
uses: chains-project/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
${action_content}
```
If a pom.xml file is changed this action will add a commit with the updated lockfile to the pull request.
Otherwise, it will validate the lockfile and fail if the lockfile is correct.
Expand Down

0 comments on commit 21038b8

Please sign in to comment.