Skip to content

Commit

Permalink
reset master to 4.23.1 (d9a4a92) (liquibase#4873)
Browse files Browse the repository at this point in the history
This PR resets master to d9a4a92, which is the commit associated with the 4.23.1 release tag.

```
$ git reset --hard d9a4a92
$ git reset --soft ad6517d
```

```
PS C:\dev\git\liquibase> git reset --hard d9a4a92
HEAD is now at d9a4a92 Merge pull request liquibase#4643 from liquibase/github-action-DAT-15622-build-installer
PS C:\dev\git\liquibase> git reset --soft ad6517d
```
  • Loading branch information
StevenMassaro committed Sep 11, 2023
1 parent ad6517d commit acfe8ed
Show file tree
Hide file tree
Showing 196 changed files with 1,142 additions and 4,340 deletions.
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Expand Up @@ -14,10 +14,6 @@ updates:
open-pull-requests-limit: 50
schedule:
interval: "daily"
pull-request-branch-name:
# Separate sections of the branch name with a hyphen
# for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1`
separator: "-"
ignore:
- dependency-name: "actions/delete-package-versions"
update-types: ["version-update:semver-major"]
14 changes: 14 additions & 0 deletions .github/util/re-version.sh
Expand Up @@ -152,3 +152,17 @@ cp $workdir/internal/lib/liquibase-commercial.jar $workdir/tgz-repackage/interna
find $workdir/tgz-repackage -name "*.txt" -exec sed -i -e "s/0-SNAPSHOT/$version/" {} \;
(cd $workdir/tgz-repackage && tar -czf $outdir/liquibase-$version.tar.gz *)
(cd $workdir/tgz-repackage && zip -qr $outdir/liquibase-$version.zip *)

## Reversion deb package
sudo apt-get update
sudo apt-get -y install dpkg-dev
mv $workdir/liquibase-0-SNAPSHOT.deb $workdir/liquibase-$version.deb
tmp_dir=temp_deb/DEBIAN
mkdir -p $tmp_dir
dpkg-deb -x $workdir/liquibase-$version.deb $tmp_dir
dpkg-deb -e $workdir/liquibase-$version.deb $tmp_dir
sed -i "s/Version: .*/Version: $version/" "$tmp_dir/control"
rm -rf $workdir/liquibase-$version.deb
dpkg-deb -b temp_deb $workdir/liquibase-$version.deb
rm -rf temp_deb
cp $workdir/liquibase-$version.deb $outdir/liquibase-$version.deb
98 changes: 42 additions & 56 deletions .github/workflows/build-branch.yml
Expand Up @@ -2,73 +2,24 @@ name: Build Branch SNAPSHOT

on:
workflow_dispatch:
#push:
#branches:
#- 'master'
pull_request:
types:
- opened
- reopened
- synchronize
push:
branches-ignore:
- master

env:
MAVEN_VERSION: '3.9.2'

jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
timeStamp: ${{ steps.get-timestamp.outputs.timestamp }}
thisBranchName: ${{ steps.get-branch-name.outputs.thisBranchName }}
thisSha: ${{ steps.get-commit-sha.outputs.thisSha }}
setupSuccessful: "true"

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.event.after}}

- name: Get commit-sha
id: get-commit-sha
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const helper = require('./.github/util/workflow-helper.js')({github, context});
core.setOutput("thisSha", helper.getCurrentSha());
- name: Get Timestamp
id: get-timestamp
run: |
timeStamp=$(date +'%Y-%m-%d %H:%M:%S %Z')
echo "timestamp=${timeStamp}" >> $GITHUB_OUTPUT
- name: Get Current BranchName
id: get-branch-name
run: |
# this logic checks if the branch is from a forked repository PR or not. Where -n is the inverse of -z (not empty)
if [ -n "${GITHUB_HEAD_REF}" ];
then
branch_name=${GITHUB_HEAD_REF}
else
branch_name=${{ github.ref_name }}
fi
modified_branch_name=`(echo $branch_name | tr / -)`
echo "thisBranchName=$modified_branch_name" >> $GITHUB_OUTPUT
build:
name: Build & Package
runs-on: ubuntu-22.04
needs: setup
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.event.after}}
- name: Set up Java for publishing to GitHub Repository
uses: actions/setup-java@v3
with:
Expand All @@ -85,12 +36,47 @@ jobs:
# Version artifact based off of branch and commit SHA.
- name: Version Artifact
run: |
mvn versions:set "-DnewVersion=${{ needs.setup.outputs.thisBranchName }}-SNAPSHOT"
#mvn versions:set "-DnewVersion=${{ inputs.branchName }}-SNAPSHOT"
version=${{ github.ref_name }}-SNAPSHOT
# Replace / with - in branch name
version=$(echo "$version" | sed 's/\//-/g')
mvn versions:set -DnewVersion="$version"
# This would still deploy a package if there are test failures. Might help to have build.yml complete and then run this workflow
# Publish to GitHub Packages
- name: Publish package
run: |
mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=liquibase" "-Dbuild.repository.name=liquibase" "-Dbuild.branch=${{ needs.setup.outputs.thisBranchName }}" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.thisSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timeStamp }}"
mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=${{ needs.setup.outputs.thisRepositoryOwner }}" "-Dbuild.repository.name=${{ needs.setup.outputs.thisRepositoryName }}" "-Dbuild.branch='${{ needs.setup.outputs.thisBranchFileName }}'" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.thisSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timestamp }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
thisSha: ${{ steps.find-attributes.outputs.thisSha }}
thisBranchName: ${{ steps.find-attributes.outputs.thisBranchName }}
thisBranchFileName: ${{ steps.find-attributes.outputs.thisBranchFileName }}
thisRepositoryName: ${{ steps.find-attributes.outputs.thisRepositoryName }}
thisRepositoryOwner: ${{ steps.find-attributes.outputs.thisRepositoryOwner }}
timestamp: ${{ steps.get-date.outputs.date }}
setupSuccessful: "true"

steps:
- uses: actions/checkout@v3
- name: Get current date
id: get-date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S')"

- name: Find mvn Build Attributes
id: find-attributes
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const helper = require('./.github/util/workflow-helper.js')({github, context});
core.setOutput("thisSha", helper.getCurrentSha());
core.setOutput("thisBranchName", helper.getCurrentBranch());
core.setOutput("thisBranchFileName", helper.getCurrentBranch().replace(/[^a-zA-Z0-9\-_]/g, "_"));
core.setOutput("thisRepositoryName", helper.getRepositoryName());
core.setOutput("thisRepositoryOwner", helper.getRepositoryOwner());
111 changes: 83 additions & 28 deletions .github/workflows/build-main.yml
Expand Up @@ -13,40 +13,99 @@ env:
MAVEN_VERSION: '3.9.2'

jobs:
build:
name: Build & Package
runs-on: ubuntu-22.04
needs: setup
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3

- name: Find mvn Build Attributes
id: find-attributes
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const helper = require('./.github/util/workflow-helper.js')({github, context});
core.setOutput("thisSha", helper.getCurrentSha());
core.setOutput("thisBranchName", helper.getCurrentBranch());
core.setOutput("thisRepoName", helper.getRepositoryName());
core.setOutput("thisRepoOwner", helper.getRepositoryOwner());
- uses: actions/checkout@v3

- name: Set up Java for publishing to GitHub Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: liquibase

- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: ${{ env.MAVEN_VERSION }}

# Version artifact based off of branch and commit SHA.
- name: Version Artifact
run: mvn versions:set "-DnewVersion=master-SNAPSHOT"

# Publish to GitHub Packages
- name: Publish package
run: mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=${{ needs.setup.outputs.thisRepositoryOwner }}" "-Dbuild.repository.name=${{ needs.setup.outputs.thisRepositoryName }}" "-Dbuild.branch=${{ needs.setup.outputs.thisBranchName }}" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.thisSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timestamp }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

setup:
name: Setup
runs-on: ubuntu-22.04
outputs:
timeStamp: ${{ steps.get-timestamp.outputs.timeStamp }}
latestMergeSha: ${{ steps.get-sha.outputs.latestMergeSha }}
thisSha: ${{ steps.find-attributes.outputs.thisSha }}
thisBranchName: ${{ steps.find-attributes.outputs.thisBranchName }}
thisBranchFileName: ${{ steps.find-attributes.outputs.thisBranchFileName }}
thisRepositoryName: ${{ steps.find-attributes.outputs.thisRepositoryName }}
thisRepositoryOwner: ${{ steps.find-attributes.outputs.thisRepositoryOwner }}
timestamp: ${{ steps.get-date.outputs.date }}
setupSuccessful: "true"

steps:
- uses: actions/checkout@v3
- name: Get Latest Merge Commit SHA
id: get-sha
run: |
latest_merge_sha=`(git rev-parse --short HEAD)`
echo "latestMergeSha=${latest_merge_sha}" >> $GITHUB_OUTPUT
- name: Get current date
id: get-date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S')"

- name: Get Timestamp
id: get-timestamp
run: |
timestamp=`(date +'%Y-%m-%d %H:%M:%S %Z')`
echo "timeStamp=${timestamp}" >> $GITHUB_OUTPUT
- name: Find mvn Build Attributes
id: find-attributes
uses: actions/github-script@v6
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const helper = require('./.github/util/workflow-helper.js')({github, context});
core.setOutput("thisSha", helper.getCurrentSha());
core.setOutput("thisBranchName", helper.getCurrentBranch());
core.setOutput("thisBranchFileName", helper.getCurrentBranch().replace(/[^a-zA-Z0-9\-_]/g, "_"));
core.setOutput("thisRepositoryName", helper.getRepositoryName());
core.setOutput("thisRepositoryOwner", helper.getRepositoryOwner());

build-and-publish:
name: Build & Publish
build-sha:
name: Build & Package SHA
runs-on: ubuntu-22.04
needs: setup
permissions:
contents: read
packages: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- name: Set up Java for publishing to GitHub Repository
uses: actions/setup-java@v3
with:
Expand All @@ -60,16 +119,12 @@ jobs:
with:
maven-version: ${{ env.MAVEN_VERSION }}

# Publish master-SNAPSHOT version to GPM
- name: Version Artifact as master-SNAPSHOT
run: mvn versions:set "-DnewVersion=master-SNAPSHOT"

- name: Publish master-SNAPSHOT
run: mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=liquibase" "-Dbuild.repository.name=liquibase" "-Dbuild.branch=master" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.latestMergeSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timeStamp }}"

# Publish <commitsha>-SNAPSHOT version to GPM
- name: Version Artifact as commit-SNAPSHOT
run: mvn versions:set -DnewVersion="${{ needs.setup.outputs.latestMergeSha }}-SNAPSHOT"
# Version artifact based off of branch and commit SHA.
- name: Version Artifact
run: mvn versions:set -DnewVersion="$(git rev-parse --short HEAD)-SNAPSHOT"

- name: Publish commit-SNAPSHOT
run: mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=liquibase" "-Dbuild.repository.name=liquibase" "-Dbuild.branch=master" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.latestMergeSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timeStamp }}"
# Publish to GitHub Packages
- name: Publish package
run: mvn -B clean deploy -pl '!liquibase-dist' -DskipTests=true "-Dbuild.repository.owner=${{ needs.setup.outputs.thisRepositoryOwner }}" "-Dbuild.repository.name=${{ needs.setup.outputs.thisRepositoryName }}" "-Dbuild.branch=${{ needs.setup.outputs.thisBranchFileName }}" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ needs.setup.outputs.thisSha }}" "-Dbuild.timestamp=${{ needs.setup.outputs.timestamp }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 10 additions & 13 deletions .github/workflows/build.yml
Expand Up @@ -6,11 +6,6 @@ concurrency:

on:
workflow_dispatch:
inputs:
archive_test_results:
description: 'If set to true, the unit and integration test results will be archived to the build artifacts page.'
required: false
default: 'false'

# DAT branches can get triggered from this logic
pull_request_target:
Expand All @@ -24,7 +19,7 @@ on:
branches:
- master
- main
- github-action-**
- github-action-*
paths-ignore:
- '**.md'

Expand Down Expand Up @@ -55,8 +50,8 @@ jobs:
thisSha: ${{ steps.find-branches.outputs.thisSha }}
thisBranchName: ${{ steps.find-branches.outputs.thisBranchName }}
thisBranchFileName: ${{ steps.find-branches.outputs.thisBranchFileName }}
thisRepositoryName: ${{ steps.find-branches.outputs.thisRepoName }}
thisRepositoryOwner: ${{ steps.find-branches.outputs.thisRepoName }}
thisRepositoryName: ${{ steps.find-branches.outputs.thisRepositoryName }}
thisRepositoryOwner: ${{ steps.find-branches.outputs.thisRepositoryName }}
standAlonePR: ${{ steps.find-branches.outputs.standAlonePR }}
stablePro: ${{ steps.find-branches.outputs.stablePro }}
timestamp: ${{ steps.get-date.outputs.date }}
Expand All @@ -75,7 +70,7 @@ jobs:

- name: Get current date
id: get-date
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S')"

- name: Find corresponding branches
id: find-branches
Expand Down Expand Up @@ -208,7 +203,7 @@ jobs:
find . -name original-*.jar -exec rm {} \;
- name: Archive Test Results
if: ${{ inputs.archive_test_results == 'true' }}
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: liquibase-test-results-jdk${{ matrix.java }}
Expand Down Expand Up @@ -319,7 +314,7 @@ jobs:
run: mvn -B jar:jar jar:test-jar surefire:test -DtrimStackTrace=false -Dliquibase.sdk.testSystem.test=${{ matrix.testSystem }} -Dliquibase.sdk.testSystem.acceptLicenses=${{ matrix.testSystem }} -Dtest=*IntegrationTest,*ExecutorTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false

- name: Archive Test Results
if: ${{ inputs.archive_test_results == 'true' }}
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.prepare.outputs.testResultsArtifact }}
Expand Down Expand Up @@ -362,7 +357,7 @@ jobs:

# look for dependencies in maven
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v21
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: |
[
Expand Down Expand Up @@ -473,6 +468,8 @@ jobs:
cp liquibase-cdi-jakarta/target/liquibase-cdi-jakarta-0-SNAPSHOT-sources.jar artifacts
cp liquibase-cdi-jakarta/target/liquibase-cdi-jakarta-0-SNAPSHOT-javadoc.jar artifacts
cp liquibase-dist/target/liquibase-*.deb artifacts
echo "Source code not available for liquibase-commercial" > /tmp/readme.source.txt
(cd /tmp && jar cf liquibase-commercial-${{ needs.setup.outputs.proBranchName }}-SNAPSHOT-sources.jar readme.source.txt)
Expand Down Expand Up @@ -523,7 +520,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# this triggers the pro-tests and test-harness to run
# this triggers the pro-tests and test-harness to run
finish:
name: Finish Build
runs-on: ubuntu-22.04
Expand Down

0 comments on commit acfe8ed

Please sign in to comment.