Skip to content

Commit 71c9194

Browse files
committed
Move to GH release process due to Bintray shutdown
1 parent 6c6302d commit 71c9194

File tree

4 files changed

+35
-25
lines changed

4 files changed

+35
-25
lines changed

.github/workflows/release-tag.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,30 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v2
14+
1415
- name: Set up JDK 1.8
1516
uses: actions/setup-java@v1
1617
with:
1718
java-version: 1.8
19+
1820
- name: Set release version
19-
run: echo "::set-env name=RELEASE_VERSION::${GITHUB_REF##*/}"
21+
run: echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
22+
2023
- name: Build with JCompilo
2124
run: BUILD_NUMBER="$RELEASE_VERSION" ./jcompilo.sh
22-
- name: Publish to Bintray
23-
run: bin/publish "$RELEASE_VERSION" "$BINTRAY_USERNAME" "$BINTRAY_PASSWORD"
25+
26+
- name: Release
27+
uses: softprops/action-gh-release@v1
28+
with:
29+
body: ${{ github.event.head_commit.message }}
30+
draft: false
31+
prerelease: false
32+
files: |
33+
build/artifacts/utterlyidle-${{ env.RELEASE_VERSION }}.pom
34+
build/artifacts/utterlyidle-${{ env.RELEASE_VERSION }}.jar
35+
build/artifacts/utterlyidle-${{ env.RELEASE_VERSION }}-sources.jar
36+
37+
- name: Publish to GitHub Packages
38+
run: bin/publish "$RELEASE_VERSION" "$GH_PACKAGES_TOKEN"
2439
env:
25-
BINTRAY_USERNAME: ${{ secrets.BINTRAY_USERNAME }}
26-
BINTRAY_PASSWORD: ${{ secrets.BINTRAY_PASSWORD }}
40+
GH_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}

bin/publish

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ set -euo pipefail
44
IFS=$'\n\t'
55

66
print_usage_and_exit() {
7-
echo "Usage: $0 <build-version> <bintray api username> <bintray api key>" >&2
7+
echo "Usage: $0 <build-version> <api-token>" >&2
88
exit 1
99
}
1010

1111
main() {
1212
local ARTEFACT_NAME="utterlyidle"
1313
local ORGANISATION_NAME="bodar"
14-
local REPOSITORY_NAME="maven"
14+
local REPOSITORY_NAME="utterlyidle"
1515

1616
local BUILD_VERSION=${1:-}
17-
local API_USERNAME=${2:-}
18-
local API_KEY=${3:-}
19-
[[ -z "$BUILD_VERSION" || -z "$API_USERNAME" || -z "$API_KEY" ]] && print_usage_and_exit
17+
local API_TOKEN=${2:-}
18+
[[ -z "$BUILD_VERSION" || -z "$API_TOKEN" ]] && print_usage_and_exit
2019

2120
local BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
2221
local ARTEFACTS_DIR="$BASE_DIR/build/artifacts"
@@ -32,12 +31,15 @@ main() {
3231
exit 3
3332
fi
3433

35-
local GROUP_PATH=$(cat "$POM_ARTEFACT" | grep groupId | head -1 | cut -f2 -d'>' | cut -f1 -d'<' | sed 's%\.%/%g')
34+
local GROUP_PATH=$(cat "$POM_ARTEFACT" | grep groupId | cut -f2 -d'>' | cut -f1 -d'<' | sed 's%\.%/%g')
3635

3736
for ARTEFACT_FILE in $ARTEFACTS_DIR/{*.jar,*.pom}; do
3837
local FILE_NAME=$(basename -- "$ARTEFACT_FILE")
3938
echo "Publishing $FILE_NAME... "
40-
curl -T "$ARTEFACT_FILE" "-u$API_USERNAME:$API_KEY" "https://api.bintray.com/content/$ORGANISATION_NAME/$REPOSITORY_NAME/$ARTEFACT_NAME/$BUILD_VERSION/$GROUP_PATH/$ARTEFACT_NAME/$BUILD_VERSION/$FILE_NAME;publish=1"
39+
curl -X PUT -v \
40+
-H "Authorization: token $API_TOKEN" \
41+
--upload-file "$ARTEFACT_FILE" \
42+
"https://maven.pkg.github.com/$ORGANISATION_NAME/$REPOSITORY_NAME/$GROUP_PATH/$ARTEFACT_NAME/$BUILD_VERSION/$FILE_NAME"
4143
echo ""
4244
done
4345
}

build/runtime.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
mvn://dl.bintray.com/bodar/maven/com.googlecode.totallylazy:totallylazy:jar|sources:2.286
2-
mvn://dl.bintray.com/bodar/maven/com.googlecode.yadic:yadic:jar|sources:2.49
1+
https://github.com/bodar/totallylazy/releases/download/2.287/totallylazy-2.287.jar
2+
https://github.com/bodar/yadic.java/releases/download/2.50/yadic-2.50.jar

jcompilo.sh

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
#!/bin/sh
22
set -e
33

4+
45
JAVA_VERSION=${JAVA_VERSION-8}
56
JAVA_OPTS="-server -XX:+TieredCompilation -Djava.net.useSystemProxies=true ${JAVA_OPTS}"
67
BUILD_NUMBER=${BUILD_NUMBER-dev.build}
7-
version=2.51
8+
version=2.52
89
artifact=jcompilo
9-
group=com/googlecode/${artifact}
10-
repo=dl.bintray.com/bodar/maven
1110
dir=lib/
1211
jar=${dir}${artifact}.jar
13-
pack=${dir}${artifact}.pack.gz
14-
url=http://${repo}/${group}/${artifact}/${version}/${artifact}-${version}
15-
remote_file=${url}.pack.gz
12+
url=https://github.com/bodar/${artifact}/releases/download/${version}/${artifact}-${version}.jar
1613
remote_sh=${url}.sh
1714

1815
type -t setjava > /dev/null && setjava -q ${JAVA_VERSION} || if [ -n "${JAVA_HOME}" ]; then PATH=${JAVA_HOME}/bin:${PATH}; fi
1916

2017
if [ "$1" = "update" ]; then
21-
rm -f ${jar} ${pack}
18+
rm -f ${jar}
2219
fi
2320

2421
if [ ! -f ${jar} ]; then
2522
mkdir -p ${dir}
26-
wget -O ${pack} ${remote_file} || curl -o ${pack} ${remote_file}
27-
unpack200 ${pack} ${jar}
28-
rm -f ${pack}
29-
#wget -O $0 ${remote_sh} || curl -o $0 ${remote_sh}
23+
wget -O ${jar} ${url} || curl -o ${jar} ${url}
3024
fi
3125
exec java -showversion -Dbuild.number=${BUILD_NUMBER} ${JAVA_OPTS} -jar ${jar} $*

0 commit comments

Comments
 (0)