Skip to content

Commit

Permalink
commit files during CI workflow if build successful
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldanan committed Jun 13, 2024
1 parent e2ec771 commit a7e46bd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 57 deletions.
65 changes: 41 additions & 24 deletions .github/workflows/buildci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
paths:
- 'java/**'
- 'scr/**'
- 'src/**'
- 'action.yml'
- 'package.json'
- 'package-lock.json'
Expand All @@ -18,35 +18,52 @@ on:
- main
paths:
- 'java/**'
- 'scr/**'
- 'src/**'
- 'action.yml'
- 'package.json'
- 'package-lock.json'
- 'webpack.config.js'
- '.github/workflows/buildci.yml'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Build with Maven
run: mvn -B package --file java/pom.xml
- name: Run tests
run: mvn -B test --file java/pom.xml
# Build with npm
- name: Build with npm
run: npm run buildWebpackU
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: collect action descriptor and npm build
path: |
action.yml
bundle/
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'

- name: Build with Maven
run: mvn -B package --file java/pom.xml

- name: Run tests
run: mvn -B test --file java/pom.xml

# Build with npm
- name: Build with npm
run: npm run buildWebpackU

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: collect action descriptor and npm build
path: |
action.yml
bundle/
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Commit and push built files
run: |
git add bundle/
git commit -m "Automated build update"
git push
33 changes: 0 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Set up the environment for both Java and Node.js
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'

# Build the Java application with Maven
- name: Build Java with Maven
run: mvn -B package --file java/pom.xml

- name: Run tests
run: mvn -B test --file java/pom.xml

# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

# Install npm dependencies
- name: Install npm dependencies
run: npm install

# Install ncc globally
- name: Install ncc
run: npm install -g @vercel/ncc

# Build with npm
- name: Build with npm
run: npm run buildWebpackU

# Prepare the release package
- name: Prepare the release package
id: prepare_release
run: |
REPO_NAME=$(basename $GITHUB_REPOSITORY)
VERSION=$(git describe --tags --always)
PACKAGE_NAME="${VERSION}"
mkdir -p $PACKAGE_NAME
Expand Down

0 comments on commit a7e46bd

Please sign in to comment.