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
34 changes: 34 additions & 0 deletions .github/workflows/delete-dev-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Delete dev releases

on:
workflow_call:
inputs:
tag:
description: 'Tag to delete'
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: 'Tag to delete'
required: true

permissions:
id-token: write
contents: write
packages: write

jobs:
delete:
runs-on: ubuntu-latest
steps:

- name: Delete releases and tags
continue-on-error: true
uses: dev-drprasad/delete-older-releases@v0.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
keep_latest: 0
delete_tag_pattern: "-${{inputs.tag}}"
delete_tags: true
25 changes: 25 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Nightly Release

on:
push:
branches:
- main

jobs:
set_tag:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.tagname.outputs.tag_name }}
steps:
- name: Create tagname
run: echo "tag_name=2.0" >> "$GITHUB_OUTPUT"
id: tagname
- name: Print tagname
run: echo "created tag ${{ steps.tagname.outputs.tag_name }}"
nightly:
needs: set_tag
uses: Checkmarx/ast-eclipse-plugin/.github/workflows/release.yml@main
with:
tag: ${{ needs.set_tag.outputs.tag_name }}
rbranch: "nightly"
secrets: inherit
49 changes: 43 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
name: Release Creation

on:
push:
tags:
- "*"
workflow_call:
inputs:
tag:
description: 'Next release tag'
required: true
type: string
rbranch:
description: 'Branch to publish development releases'
required: false
type: string
workflow_dispatch:
inputs:
tag:
description: 'Next release tag'
required: true
type: string
rbranch:
description: 'Branch to publish development releases'
required: false
type: string

jobs:
deleteDevReleases:
uses: Checkmarx/ast-eclipse-plugin/.github/workflows/delete-dev-releases.yml@main
with:
tag: ${{ inputs.rbranch }}
secrets: inherit
if: inputs.rbranch
release:
runs-on: ubuntu-latest
steps:
Expand All @@ -14,8 +37,20 @@ jobs:
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

# Set the tag in an env var
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
run: |
echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
- name: Create Release Name
run: |
echo "Creating release name"
if [ -z "${{ inputs.rbranch }}" ]; then
echo "GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV
echo "GH_BRANCH_NAME=main" >> $GITHUB_ENV
else
echo "GH_RELEASE_TAG_NAME=${{ env.RELEASE_VERSION }}-${{ inputs.rbranch }}" >> $GITHUB_ENV
echo "GH_BRANCH_NAME=nightly" >> $GITHUB_ENV
fi

- name: Set up JDK 8
uses: actions/setup-java@v3
Expand All @@ -40,9 +75,11 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.GH_RELEASE_TAG_NAME }}
generate_release_notes: true
files: ./com.checkmarx.eclipse.site/target/com.checkmarx.eclipse.site-*.zip

prerelease: ${{ inputs.rbranch != '' && inputs.rbranch != null }}

- name: Git configuration
run: |
git config --global safe.directory "/tmp/**/*/"
Expand All @@ -58,4 +95,4 @@ jobs:
destination-repository-username: 'CheckmarxDev'
destination-repository-name: 'ast-eclipse-plugin-update-site'
user-email: cylon-bot@checkmarx.com
target-branch: main
target-branch: ${{ env.GH_BRANCH_NAME }}