项目作者: byu-oit

项目描述 :
GitHub Action to setup BYU maven environment
高级语言: TypeScript
项目地址: git://github.com/byu-oit/github-action-setup-maven.git
创建时间: 2020-06-01T21:40:33Z
项目社区:https://github.com/byu-oit/github-action-setup-maven

开源协议:Apache License 2.0

下载


CI
Test

github-action-setup-maven" class="reference-link">BYU logo github-action-setup-maven

A GitHub Action for setting up a workflow to use BYU’s maven environment

This action will create the maven settings.xml file along with the security-settings.xml file to allow your workflow to access the BYU maven repository.

Note: This action does not install maven, nor java (both are already included in workflows by default).
If you need to install a different version of java you can use the setup-java action.

Usage

  1. on: push
  2. # ...
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. steps:
  7. # ...
  8. - name: Setup Maven
  9. uses: byu-oit/github-action-setup-maven@v1
  10. with:
  11. maven-master-password: ${{ secrets.maven_master_password }}
  12. - run: mvn install

After this step your workflow should have access to the BYU maven repository (Artifactory).
Your normal mvn commands will work just fine.

Example with caching

  1. on: push
  2. # ...
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. steps:
  7. # ...
  8. - name: Setup Maven
  9. uses: byu-oit/github-action-setup-maven@v1
  10. with:
  11. maven-master-password: ${{ secrets.maven_master_password }}
  12. - name: Caching Maven
  13. id: cache-maven
  14. uses: actions/cache@v2
  15. with:
  16. path: ~/.m2/repository
  17. key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
  18. restore-keys: |
  19. ${{ runner.os }}-maven-
  20. - name: Resolve Maven Dependencies
  21. if: steps.cache-maven.outputs.cache-hit != 'true'
  22. run: mvn dependency:resolve
  23. - run: mvn install

Inputs

  • maven-master-password - (required) pass in the encrypted maven master password that was used to create the encrypted secrets in the maven settings file.
    Use GitHub secrets, NEVER commit the password in plaintext.

Contributing

Hopefully this is useful to others at BYU.
Feel free to ask me some questions about it, but I make no promises about being able to commit time to support it.

GitHub Actions will run the entry point from the action.yml.
In our case, that happens to be /dist/index.js.

Actions run from GitHub repos.
We don’t want to check in node_modules. Hence, we package the app using yarn run pack.

Modifying Source Code

Just run yarn install locally.
There aren’t many files here, so hopefully it should be pretty straightforward.

Cutting new releases

Push your code up to a feature branch.
Create a pull request to the v1 branch (if it’s a non breaking change).

After it’s merged into the v1 branch then, be sure to create a new GitHub release, following SemVer.
Then merge v1 into master.