-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/github_actions/robinraju/release-…
…downloader-1.8
- Loading branch information
Showing
21 changed files
with
1,280 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>${groupId}</groupId> | ||
<artifactId>${artifactId}</artifactId> | ||
<version>${revision}</version> | ||
<description>Universal pom for deb packaging</description> | ||
|
||
<properties> | ||
<maven.antrun.version>3.1.0</maven.antrun.version> | ||
<org.vafer.jdeb.version>1.10</org.vafer.jdeb.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>${maven.antrun.version}</version> | ||
<executions> | ||
<execution> | ||
<id>unpack</id> | ||
<phase>package</phase> | ||
<configuration> | ||
<target> | ||
<untar src="${project.build.directory}/${project.artifactId}-${project.version}.tar.gz" compression="gzip" dest="${project.build.directory}/dist-unpacked" /> | ||
</target> | ||
</configuration> | ||
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.vafer</groupId> | ||
<artifactId>jdeb</artifactId> | ||
<version>${org.vafer.jdeb.version}</version> | ||
<executions> | ||
<execution> | ||
<id>create-deb</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>jdeb</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<deb>${project.build.directory}/${project.artifactId}-${project.version}.deb</deb> | ||
<controlDir>${project.basedir}/src/${project.artifactId}/deb/control</controlDir> | ||
<dataSet> | ||
<data> | ||
<src>${project.build.directory}/dist-unpacked</src> | ||
<type>directory</type> | ||
<mapper> | ||
<type>perm</type> | ||
<prefix>/usr/bin</prefix> | ||
<filemode>755</filemode> | ||
</mapper> | ||
</data> | ||
</dataSet> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [[ -z "$GITHUB_TOKEN" ]]; then | ||
echo "Set the GITHUB_TOKEN env variable." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$ASSET_NAME_PREFIX" ]]; then | ||
echo "Set the ASSET_NAME_PREFIX env variable." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$ASSET_DIR" ]]; then | ||
echo "Set the ASSET_DIR env variable." | ||
exit 1 | ||
fi | ||
|
||
VERSION=$1 | ||
if [[ -z "$VERSION" ]]; then | ||
echo "Set the VERSION parameter." | ||
exit 1 | ||
fi | ||
|
||
_DIR=$(dirname "$0") | ||
UPLOAD_URL=$($_DIR/get_draft_release.sh UPLOAD_URL) | ||
|
||
upload_asset() { | ||
local file=$1 | ||
local size=$2 | ||
local content_type=$3 | ||
echo "Uploading $file ($size bytes) to $UPLOAD_URL" | ||
curl \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Length: $size"\ | ||
-H "Content-Type: $content_type" \ | ||
--data-binary @$file "$UPLOAD_URL?name=$(basename $file)" | ||
} | ||
|
||
EXTENSION=".zip" | ||
FILE=$ASSET_DIR/$ASSET_NAME_PREFIX$VERSION$EXTENSION | ||
# Skip if zip files do not exist (some extensions do not generate examples in zip format) | ||
if [[ ! -f "$FILE" && "$FILE" != *".zip" ]]; then | ||
echo "$FILE does not exist." | ||
fi | ||
SIZE=$(wc -c $FILE | awk '{print $1}') | ||
if [[ $SIZE -eq 0 ]]; then | ||
echo "$FILE is empty." | ||
fi | ||
MIME=$(file -b --mime-type $FILE) | ||
upload_asset $FILE $SIZE $MIME | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# The name of the workflow | ||
name: Automerge Dependabot PRs | ||
|
||
# The event that triggers the workflow | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
dependabot: | ||
# The name of the job | ||
name: Merge dependabot | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# The permissions for the GITHUB_TOKEN | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
# Conditional statement to run the job only when the event was triggered by 'dependabot[bot]' | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
|
||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
# Use 'dependabot/fetch-metadata' to fetch the metadata about the update | ||
uses: dependabot/fetch-metadata@v1.3.1 | ||
|
||
- name: Approve patch and minor updates | ||
# Conditional statement to run the steps only when the update type is a patch or minor | ||
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}} | ||
run: | | ||
# Command to merge the PR | ||
gh pr merge --auto --merge "$PR_URL" | ||
# Command to approve the PR with a custom message | ||
gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**" | ||
env: | ||
# The URL of the PR to be merged and approved | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
# The GitHub token secret | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Prepare release | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
prepare-release: | ||
name: Prepare release | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 17 | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
overwrite-settings: false | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "liquibot" | ||
git config user.email "liquibot@liquibase.org" | ||
- name: Prepare Maven Release | ||
run: | | ||
mvn -B build-helper:parse-version versions:set release:clean release:prepare \ | ||
-Dusername=liquibot -Dpassword=$GITHUB_TOKEN \ | ||
-Darguments="-Dmaven.javadoc.skip=true -Dmaven.test.skipTests=true -Dmaven.test.skip=true -Dmaven.deploy.skip=true" \ | ||
-DdevelopmentVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.\${parsedVersion.incrementalVersion} \ | ||
-DcheckModificationExcludeList=pom.xml | ||
- name: Save Release files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-files | ||
path: | | ||
**/pom.xml.* | ||
**/release.properties | ||
release-rollback: | ||
needs: prepare-release | ||
if: ${{ always() && contains(needs.*.result, 'failure') }} | ||
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.4.5 | ||
secrets: inherit |
Oops, something went wrong.