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

DAT-15272 #390

Merged
merged 6 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
create draft release
  • Loading branch information
Sayali M authored and Sayali M committed Jun 29, 2023
commit e64ab54534764faf8bf1959bf8817e0c0388b158
50 changes: 50 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

name-template: 'Support for Liquibase v$RESOLVED_VERSION \n **Full Changelog**: https://github.com/liquibase/liquibase-mongodb/compare/liquibase-mongodb-$PREVIOUS_TAG...liquibase-mongodb-$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
exclude-labels:
- 'skipReleaseNotes'
categories:
- title: ':green_book: Notable Changes'
labels:
- 'notableChanges'
- title: '🚀 New Features'
labels:
- 'TypeEnhancement'
- 'TypeTest'
- title: '🐛 Bug Fixes 🛠'
labels:
- 'TypeBug'
- title: '💥 Breaking Changes'
labels:
- 'breakingChanges'
- title: '🤖 Security Driver and Other Updates'
collapse-after: 5
labels:
- 'sdou'
- 'dependencies'
- title: '👏 New Contributors'
labels:
- 'newContributors'


change-template: '- (#$NUMBER) $TITLE @$AUTHOR '
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'feature'
- 'enhancement'
- 'patch'
- 'bugfix'
- 'sdou'
default: patch
template: |
## Changes

$CHANGES
227 changes: 120 additions & 107 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,113 +50,126 @@ jobs:
outputs:
releaseSha: ${{ steps.get-release-sha.outputs.releaseSha }}
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

- name: Update branch with latest commits # needed for getting the latest pom.xml generated by release-prepare step
# Get the $PREVIOUS_TAG for release-drafter job in .github/release-drafter.yml
- name: Get previous tag
id: prev_tag
run: |
git pull origin ${{ env.GITHUB_REF_NAME }}
git checkout HEAD~1

- name: Cache Built Code
uses: actions/cache@v2
with:
key: built-code-${{ github.run_id }}
path: ./**/target

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'

- name: Download and install liquibase-core.jar
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "liquibase/liquibase"
version: "tags/v${{ needs.setup.outputs.liquibaseVersion }}"
file: "liquibase-core-${{ needs.setup.outputs.liquibaseVersion }}.jar"
target: "liquibase-core.jar"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install liquibase-core.jar
run: mvn -B org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file -Dfile=liquibase-core.jar

- name: Get release SHA
id: get-release-sha
run: echo ::set-output name=releaseSha::$(git rev-parse HEAD)


- name: Build and Unit Test
run: mvn -B clean test package

- name: Archive Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-reports-jdk
path: ./**/target/surefire-reports
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^)
echo "::set-output name=previous_tag::$PREVIOUS_TAG"

- name: Save Artifacts
uses: actions/upload-artifact@v2
- name: Run Release Drafter
uses: release-drafter/release-drafter@v7
with:
name: liquibase-mongodb
path: |
target/*.jar
pom.xml

integration-tests:
name: Java ${{ matrix.java }}
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
java: [8, 11, 17]
mongodb: [4]
services:
mongodb:
image: mongo:${{ matrix.mongodb }}
ports:
- 27017-27019:27017-27019

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Test With Maven
run: mvn clean verify -Prun-its --file pom.xml

draft-release:
needs: [ setup, build, integration-tests, release-prepare ]
name: Draft Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: liquibase-mongodb

- name: Release
uses: softprops/action-gh-release@v1
with:
target_commitish: ${{ needs.build.outputs.releaseSha }}
name: v${{ needs.setup.outputs.extensionVersion }}
tag_name: liquibase-mongodb-${{ needs.setup.outputs.extensionVersion }}
draft: true
body: Support for Liquibase ${{ needs.setup.outputs.liquibaseVersion }}.
files: target/liquibase-mongodb-*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-rollback:
needs: [ setup, release-prepare, build, integration-tests, draft-release ]
if: ${{ failure() }}
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.3.2
secrets: inherit
config-path: .github/release-drafter.yml
name-template: "v${{ steps.prev_tag.outputs.previous_tag }}"

# - uses: actions/checkout@v2
# with:
# persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
# fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

# - name: Update branch with latest commits # needed for getting the latest pom.xml generated by release-prepare step
# run: |
# git pull origin ${{ env.GITHUB_REF_NAME }}
# git checkout HEAD~1

# - name: Cache Built Code
# uses: actions/cache@v2
# with:
# key: built-code-${{ github.run_id }}
# path: ./**/target

# - name: Set up JDK
# uses: actions/setup-java@v2
# with:
# java-version: '8'
# distribution: 'adopt'

# - name: Download and install liquibase-core.jar
# uses: dsaltares/fetch-gh-release-asset@master
# with:
# repo: "liquibase/liquibase"
# version: "tags/v${{ needs.setup.outputs.liquibaseVersion }}"
# file: "liquibase-core-${{ needs.setup.outputs.liquibaseVersion }}.jar"
# target: "liquibase-core.jar"
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Install liquibase-core.jar
# run: mvn -B org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file -Dfile=liquibase-core.jar

# - name: Get release SHA
# id: get-release-sha
# run: echo ::set-output name=releaseSha::$(git rev-parse HEAD)


# - name: Build and Unit Test
# run: mvn -B clean test package

# - name: Archive Test Results
# if: ${{ always() }}
# uses: actions/upload-artifact@v2
# with:
# name: test-reports-jdk
# path: ./**/target/surefire-reports

# - name: Save Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: liquibase-mongodb
# path: |
# target/*.jar
# pom.xml

# integration-tests:
# name: Java ${{ matrix.java }}
# runs-on: ubuntu-latest
# needs: build
# strategy:
# matrix:
# java: [8, 11, 17]
# mongodb: [4]
# services:
# mongodb:
# image: mongo:${{ matrix.mongodb }}
# ports:
# - 27017-27019:27017-27019

# steps:
# - uses: actions/checkout@v2
# - name: Set up JDK ${{ matrix.java }}
# uses: actions/setup-java@v2
# with:
# java-version: ${{ matrix.java }}
# distribution: 'adopt'
# - name: Test With Maven
# run: mvn clean verify -Prun-its --file pom.xml

# draft-release:
# needs: [ setup, build, integration-tests, release-prepare ]
# name: Draft Release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2

# - name: Download Artifacts
# uses: actions/download-artifact@v2
# with:
# name: liquibase-mongodb

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# target_commitish: ${{ needs.build.outputs.releaseSha }}
# name: v${{ needs.setup.outputs.extensionVersion }}
# tag_name: liquibase-mongodb-${{ needs.setup.outputs.extensionVersion }}
# draft: true
# body: Support for Liquibase ${{ needs.setup.outputs.liquibaseVersion }}.
# files: target/liquibase-mongodb-*.jar
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# release-rollback:
# needs: [ setup, release-prepare, build, integration-tests, draft-release ]
# if: ${{ failure() }}
# uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.3.2
# secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Drafter

on:
workflow_dispatch:
push:
branches:
- master

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}