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

Snapshots Workflow #126

Merged
merged 20 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
release:
types: [ released ]


jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -14,8 +15,9 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
distribution: 'temurin'

- name: Publish package
run: ./bin/mac/deploy.sh
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103 changes: 103 additions & 0 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Publish Snapshots

on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- 'snapshots-tests'

jobs:
delete_older_snapshots:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:

- name: Delete older snapshots
uses: smartsquaregmbh/delete-old-packages@v0.7.0
with:
organization: assimbly
type: maven
keep: 0
version-pattern: "^\\S+\\-SNAPSHOT$"
names: |
org.assimbly.runtime
org.assimbly.integration-rest
org.assimbly.integration
org.assimbly.dil
org.assimbly.broker-rest
org.assimbly.broker

publish_runtime_snapshot:
needs: [delete_older_snapshots]

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:

- name: Checkout the code
uses: actions/checkout@v3
with:
ref: "develop"

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

- name: Setup Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v20

with:

repositories: >
[
{
"id": "maven",
"name": "Maven Central",
"url": "https://repo1.maven.org/maven2"
},
{
"id": "github",
"name": "Assimbly Base Repository",
"url": "https://maven.pkg.github.com/assimbly/base",
"snapshots": {
"enabled": "true"
}
},
{
"id": "aurea",
"name": "Aurea Sonic Repository",
"url": "https://int-factory.aurea.com/nexus/content/repositories/sonic-releases/"
}
]

servers: >
[
{
"id": "github",
"username": "assimbly",
"password": "${{ secrets.GITHUB_TOKEN }}"
}
]

- name: Update POM Version
env:
VERSION: 4.0.0-SNAPSHOT
run: |
echo "Updating to version: ${VERSION}"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION}
mvn versions:set-property -Dproperty=assimbly.version -DnewVersion=${VERSION}

- name: Publish package
run: mvn --batch-mode deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}