diff --git a/.github/workflows/build-action.yaml b/.github/workflows/pr_into_master.yaml similarity index 93% rename from .github/workflows/build-action.yaml rename to .github/workflows/pr_into_master.yaml index 9b92931..436db2d 100644 --- a/.github/workflows/build-action.yaml +++ b/.github/workflows/pr_into_master.yaml @@ -1,12 +1,11 @@ -name: "Build and test Maven GitHub action" +name: "Build and test release Maven GitHub action" on: pull_request: branches: [ master ] - push: jobs: - build: + build_and_test: name: "Set up Maven and validate" runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/push_into_none_master.yaml b/.github/workflows/push_into_none_master.yaml new file mode 100644 index 0000000..67a4cd4 --- /dev/null +++ b/.github/workflows/push_into_none_master.yaml @@ -0,0 +1,49 @@ +name: "Build and test release Maven GitHub action" + +on: + push: + branches: + - !master + +jobs: + build_and_test: + name: "Set up Maven and validate it" + runs-on: ubuntu-latest + steps: + - name: "Checkout code" + uses: actions/checkout@v2 + + - name: "Set Node.js" + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: "Install" + run: npm install + + - name: "Run build" + run: npm run build + + - name: "Install ncc" + run: npm i -g @vercel/ncc + + - name: "Run distribution" + run: npm run build-dist + + - name: "Set up JDK" + uses: actions/setup-java@v2 + with: + java-version: "8" + distribution: "adopt" + + - name: "Set Maven from local GitHub action" + uses: ./ + with: + maven-version: 3.8.1 + + - name: "Validate Maven version" + run: mvn -v | head -1 | grep "3.8.1" + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "Apply local changes" diff --git a/.github/workflows/test_maven_actions.yaml b/.github/workflows/push_to_master.yaml similarity index 92% rename from .github/workflows/test_maven_actions.yaml rename to .github/workflows/push_to_master.yaml index 18bb195..0f03476 100644 --- a/.github/workflows/test_maven_actions.yaml +++ b/.github/workflows/push_to_master.yaml @@ -1,4 +1,4 @@ -name: "Test Maven GitHub action" +name: "Test master branch Maven GitHub action" on: push: