forked from devonfw/IDEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
345 additions
and
6 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,17 @@ | ||
name: Delete cancelled workflow runs | ||
on: | ||
schedule: | ||
- cron: '0 6 * * *' | ||
|
||
jobs: | ||
del_runs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Delete cancelled workflow runs | ||
uses: Mattraks/delete-workflow-runs@v2 | ||
with: | ||
token: ${{ github.token }} | ||
repository: ${{ github.repository }} | ||
retain_days: 0 | ||
keep_minimum_runs: 0 | ||
delete_run_by_conclusion_pattern: cancelled |
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,87 @@ | ||
name: Nightly CI Build and Snapshot Release | ||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
verify_commit: | ||
runs-on: ubuntu-latest | ||
name: Verify latest commit | ||
outputs: | ||
RUN_BUILD: ${{ steps.verify_commit.outputs.RUN_BUILD }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- id: verify_commit | ||
name: Verify latest commit is less than 24 hours | ||
if: ${{ github.event_name == 'schedule' }} | ||
run: echo '::set-output name=RUN_BUILD::'$(test -n "$(git log --format=%H --since='24 hours ago')" && echo 'true' || echo 'false') | ||
|
||
build-natives: | ||
name: Build native images | ||
runs-on: ${{ matrix.os }} | ||
needs: verify_commit | ||
if: ${{ needs.verify_commit.outputs.RUN_BUILD == 'true' }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: '17.0.7' | ||
distribution: 'graalvm' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
native-image-job-reports: 'true' | ||
|
||
- name: Build native images with nativ maven plugin and extract in tar.gz | ||
shell: bash | ||
run: | | ||
mvn -B -ntp -Pnative -DskipTests=true package | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: natives | ||
path: cli/target/*.tar.gz | ||
|
||
build: | ||
name: Build Project and Deploy | ||
needs: [build-natives, verify_commit] | ||
if: ${{ needs.verify_commit.outputs.RUN_BUILD == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '17' | ||
- uses: actions/download-artifact@v3 | ||
- name: Make natives available and build project | ||
run: | | ||
mv ./natives/* ./cli/ | ||
mvn -B -ntp -Dstyle.color=always install | ||
- name: Deploy to OSSRH nexus | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dmaven.install.skip=true -Dstyle.color=always -B -ntp deploy | ||
|
||
cancel: | ||
name: Cancel this workflow | ||
runs-on: ubuntu-latest | ||
needs: verify_commit | ||
if: ${{ needs.verify_commit.outputs.RUN_BUILD == 'false' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OWNER: ${{ github.repository_owner }} | ||
REPO: ${{ github.event.repository.name }} | ||
RUN_ID: ${{ github.run_id }} | ||
steps: | ||
- run: | | ||
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$OWNER/$REPO/actions/runs/$RUN_ID/cancel" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build and deploy a release including native-images | ||
on: push | ||
jobs: | ||
build-natives: | ||
name: Build native images | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: feature/release-workflow | ||
|
||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: '17.0.7' | ||
distribution: 'graalvm' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
native-image-job-reports: 'true' | ||
|
||
- name: Build native images with nativ maven plugin and extract in tar.gz | ||
shell: bash | ||
run: | | ||
maven_config="$(cat .mvn/maven.config)" | ||
current_version="${maven_config/#*-Drevision=}" | ||
current_version="${current_version/ */}" | ||
cd cli | ||
mvn -B -ntp -Pnative -DskipTests=true package | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: natives | ||
path: cli/target/*.tar.gz | ||
|
||
|
||
attach-artifacts: | ||
name: Attach OS specific tar.gz and create release | ||
runs-on: ubuntu-latest | ||
needs: [build-natives] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '17' | ||
- uses: actions/download-artifact@v3 | ||
- name: Create release for Nexus and Github | ||
run: | | ||
maven_config="$(cat .mvn/maven.config)" | ||
current_version="${maven_config/#*-Drevision=}" | ||
current_version="${current_version/ */}" | ||
ls -R | ||
mvn -B -ntp -DskipTests=true -Dstyle.color=always install | ||
mv ./natives/* ./cli/target/ | ||
gh release create ${current_version} ./cli/target/*.tar.gz | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.