Skip to content

Commit

Permalink
Update deployment to run only on manually triggered workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer198 committed Sep 14, 2023
1 parent c9a8825 commit ae1e43f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 37 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy CrySL

on: [workflow_dispatch]

jobs:
deployment:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
name: Deployment in ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
# Sets up Java version
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-package: 'jdk'
java-version: '11'
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
# Sets up Maven version
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.6.3
- 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 }}
38 changes: 1 addition & 37 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,40 +107,4 @@ jobs:
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git tag -a ${{ steps.versioning.outputs.version }} -m "CrySL version ${{ steps.versioning.outputs.version }}"
git push origin ${{ steps.versioning.outputs.version }}
deployment:
# Sonatype allows the deployment of one version exactly once. If the version gets updated, the new version will be
# deployed automatically
needs: version-release
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
name: Deployment in ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
# Sets up Java version
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-package: 'jdk'
java-version: '11'
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
# Sets up Maven version
- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.6.3
- 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 }}
git push origin ${{ steps.versioning.outputs.version }}

0 comments on commit ae1e43f

Please sign in to comment.