-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add bundling and github action CI CD to publish package (#7)
- Loading branch information
1 parent
db496ea
commit d5085d9
Showing
11 changed files
with
5,538 additions
and
4,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"useBuiltIns": "entry" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
# This job uses skip-duplicate-actions to skip one of the duplicate workflow runs when you push to a branch with an open PR. | ||
check_duplicate_workflow: | ||
needs: [] | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/[email protected] | ||
with: | ||
skip_after_successful_duplicate: 'true' | ||
concurrent_skipping: 'same_content_newer' | ||
do_not_skip: '["push"]' | ||
|
||
lint: | ||
needs: [check_duplicate_workflow] | ||
runs-on: ubuntu-20.04 | ||
if: ${{ needs.check_duplicate_workflow.outputs.should_skip != 'true' }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Run lint | ||
run: ./gradlew lint | ||
|
||
build: | ||
needs: [check_duplicate_workflow] | ||
runs-on: ubuntu-20.04 | ||
if: ${{ needs.check_duplicate_workflow.outputs.should_skip != 'true' }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Build bundles | ||
run: ./gradlew build | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.sha }}-${{ github.run_id }}-bundles | ||
path: build | ||
retention-days: 3 | ||
|
||
test: | ||
needs: [check_duplicate_workflow] | ||
runs-on: ubuntu-20.04 | ||
if: ${{ needs.check_duplicate_workflow.outputs.should_skip != 'true' }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: ./gradlew unit_test | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.sha }}-${{ github.run_id }}-${{ github.job }}-results | ||
path: build/test-report | ||
retention-days: 3 | ||
- name: Publish test results | ||
uses: EnricoMi/[email protected] | ||
with: | ||
files: build/test-report/**/*.xml | ||
|
||
release: | ||
needs: [lint, build, test] | ||
runs-on: ubuntu-20.04 | ||
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELASTICPATH }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }}-${{ github.sha }}-${{ github.run_id }}-bundles | ||
path: build | ||
- name: Release, publish package | ||
run: ./gradlew release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.