Skip to content

Commit

Permalink
Merge pull request #131 from CROSSINGTUD/dependabot/maven/tycho-versi…
Browse files Browse the repository at this point in the history
…on-4.0.0

Bump tycho-version to 4.0.10 and update actions
  • Loading branch information
schlichtig authored Nov 29, 2024
2 parents 4b2c4ac + ff43b55 commit 8e21a64
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 37 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/deploy.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/deploy_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Deploy CrySL

on: [workflow_dispatch]

jobs:
deployment:
runs-on: ubuntu-latest
environment: Deploy
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Sets up Java version
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: 'jdk'
java-version: '17'
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name
server-password: OSSRH_PASSWORD # Env var that holds your OSSRH user pw
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret
gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase
# Tycho requires at least Maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
- name: Build & Deploy CrySL
run: mvn -B -U clean deploy -Pdeployment
env:
SIGN_KEY_PASS: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PW }}

release:
runs-on: ubuntu-latest
needs: deployment
- name: Checkout source code
uses: actions/checkout@v4

- name: Fetch all tags
run: git fetch --tags

- name: Extract Version from pom.xml
id: extract_version
run: |
VERSION=$(sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' pom.xml | head -n 1)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Generate Release Notes
id: generate_notes
run: |
LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)
git log $LATEST_TAG..HEAD --merges --pretty=format:"%h" > merged_prs.txt
RELEASE_NOTES="Release Notes:\n\n"
while IFS= read -r commit_hash; do
if git log -1 --pretty=format:"%s" $commit_hash | grep -iq "dependabot"; then
continue
fi
PR_NUMBER=$(git log -1 --pretty=format:"%s" $commit_hash | grep -oE "([Pp][Rr]|pull request) #[0-9]+" | grep -oE "[0-9]+" | head -n 1)
FIRST_COMMENT=$(gh pr view $PR_NUMBER --json body --jq '.body')
if [ -n "$FIRST_COMMENT" ]; then
RELEASE_NOTES+="- PR #$PR_NUMBER: $FIRST_COMMENT\n"
fi
done < merged_prs.txt
echo -e "$RELEASE_NOTES" > release_notes.txt
cat release_notes.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
run: |
gh release create "$VERSION" --title "$VERSION" --notes-file release_notes.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .github/workflows/main_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: CrySL build

on:
push:
branches-ignore:
- master
- develop
pull_request:
types: [opened, reopened]

Expand All @@ -26,6 +23,11 @@ jobs:
distribution: 'adopt'
java-package: jdk
java-version: '17'
# Tycho requires at least Maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
# Restores Maven dependecies
- name: Restore local Maven repository
uses: actions/cache@v3
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ description: Check the formatting. Use "mvn spotless:apply" to format the code.

on:
push:
branches-ignore:
- master
- develop

jobs:
check-formatting:
Expand All @@ -14,6 +11,18 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Sets up Java version
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
java-version: '17'
# Tycho requires at least Maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
# Restores Maven dependecies
- name: Restore local Maven repository
uses: actions/cache@v4
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
distribution: 'adopt'
java-package: jdk
java-version: '17'
# Tycho requires at least Maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
# Semantic versioning
- name: Semantic versioning
id: versioning
Expand Down Expand Up @@ -83,6 +88,11 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
# Tycho requires at least Maven 3.9.0
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
# Semantic versioning
- name: Semantic versioning
id: versioning
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

CrySL is a domain-specific language that allows to specify the correct usage of APIs. Example specifications for the JavaCryptographicArchitecture (JCA), BouncyCastle and Tink can be found [here](https://github.com/CROSSINGTUD/Crypto-API-Rules).

## Build
CrySL uses Maven as build tool. You can install this project via

```mvn clean install -DskipTests```

Installing requires at least Java 17 and Maven 3.9.0.

## Parsing CrySL files
We implemented a parser that reads a set of `.crysl` files and parses them into Java objects. Include the following dependency in your project (replace `x.y.z` with the latest version):

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</distributionManagement>

<properties>
<tycho-version>2.7.5</tycho-version>
<tycho-version>4.0.10</tycho-version>
<xtextVersion>2.35.0</xtextVersion>
<emfVersion>2.19.0</emfVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 8e21a64

Please sign in to comment.