-
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/dependabot/fetch-m…
…etadata-1.6.0
- Loading branch information
Showing
21 changed files
with
1,147 additions
and
80 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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.