Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI implementation using Github actions workflow and Github packages Maven repository #41

Merged
merged 9 commits into from
Jan 17, 2024
98 changes: 0 additions & 98 deletions .github/workflows/main.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create package on push to master

on:
push:
branches: [ CI_CD_Dev ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

# Do npm install and build steps for YAMCS webapp.
- name: Install dependencies and build frontend
run: |
echo ${{ github.workspace }}
cd ${{ github.workspace }}/yamcs-web/src/main/webapp
npm install
npm run build

- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn clean install -DskipTests

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -DskipTests -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
9 changes: 3 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,10 @@
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>github</id>
<name>GitHub PixxelHQ Apache Maven Packages</name>
<url>https://maven.pkg.github.com/pixxelhq/yamcs</url>
</repository>
</distributionManagement>

Expand Down
Loading