Skip to content

Commit

Permalink
Separate the release job
Browse files Browse the repository at this point in the history
Co-authored-by: Ji <[email protected]>
  • Loading branch information
will-molloy and jiyeonmolloy committed Jun 23, 2024
1 parent fac41f1 commit 898b2fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
push:
branches: [ main ]

permissions:
contents: write

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -27,7 +24,7 @@ jobs:
- name: Build
run: |
chmod +x gradlew
./gradlew projects clean build --no-daemon --refresh-dependencies
./gradlew clean build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -51,34 +48,14 @@ jobs:
distribution: corretto
java-version: 21

- name: Integration Test
- name: Integration test
run: |
chmod +x gradlew
./gradlew projects clean integrationTest --no-daemon --refresh-dependencies
./gradlew clean integrationTest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: integration-tests-${{ matrix.os }}
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

release:
needs: [ build, integration-test ]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump version
id: version
uses: paulhatch/[email protected]

- name: Create GitHub tag and release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.version.outputs.version_tag }}
generate_release_notes: true
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: release

on:
workflow_run:
workflows: [ build ]
types: [ completed ]
branches: [ main ]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Bump version
id: version
uses: paulhatch/[email protected]

- name: Create GitHub tag and release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.version.outputs.version_tag }}
generate_release_notes: true

0 comments on commit 898b2fc

Please sign in to comment.