Skip to content
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
26 changes: 26 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Nightly Release

on:
push:
branches:
- main

jobs:
delete_tag:
runs-on: ubuntu-latest
steps:
- name: Delete release
uses: dev-drprasad/delete-tag-and-release@v0.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_release: true
tag_name: 0.0.0-SNAPSHOT
nightly:
needs: delete_tag
uses: CheckmarxDev/ast-cli-java-wrapper/.github/workflows/release.yml@main
with:
tag: "0.0.0-SNAPSHOT"
dev: false
cliTag: "2.0.0-nightly"
secrets: inherit
34 changes: 0 additions & 34 deletions .github/workflows/release-dev.yml

This file was deleted.

55 changes: 49 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
name: Release Creation

on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: true
type: string
workflow_call:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: true
type: string

jobs:
release:
Expand All @@ -14,8 +41,16 @@ jobs:
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Tag
run: |
echo ${{ inputs.tag }}
tag=${{ inputs.tag }}
echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
message='${{ inputs.tag }}'
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"

- name: Cache local Maven repository
uses: actions/cache@v3
Expand All @@ -39,8 +74,16 @@ jobs:
- name: Update the POM version.
run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests

- name: Build artifactId property
run: |
prop=''
if [ ${{ inputs.dev }} = true ]; then
prop='-Dast.wrapper.id=ast-cli-java-wrapper-dev'
fi
echo "AID_PROP=${prop}" >> $GITHUB_ENV

- name: Publish package
run: mvn --batch-mode deploy -DskipTests
run: mvn --batch-mode deploy -DskipTests ${{ env.AID_PROP }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down