Skip to content

Commit 1cfaf9e

Browse files
committed
Move to GH release process due to Bintray shutdown
1 parent 234ec33 commit 1cfaf9e

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
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/totallylazy-${{ env.RELEASE_VERSION }}.pom
34+
build/artifacts/totallylazy-${{ env.RELEASE_VERSION }}.jar
35+
build/artifacts/totallylazy-${{ 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: 8 additions & 6 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="totallylazy"
1313
local ORGANISATION_NAME="bodar"
14-
local REPOSITORY_NAME="maven"
14+
local REPOSITORY_NAME="totallylazy"
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"
@@ -37,7 +36,10 @@ main() {
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
}

jcompilo.sh

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,21 @@ set -e
55
JAVA_VERSION=${JAVA_VERSION-8}
66
JAVA_OPTS="-server -XX:+TieredCompilation -Djava.net.useSystemProxies=true ${JAVA_OPTS}"
77
BUILD_NUMBER=${BUILD_NUMBER-dev.build}
8-
version=2.51
8+
version=2.52
99
artifact=jcompilo
10-
group=com/googlecode/${artifact}
11-
repo=dl.bintray.com/bodar/maven
1210
dir=lib/
1311
jar=${dir}${artifact}.jar
14-
pack=${dir}${artifact}.pack.gz
15-
url=http://${repo}/${group}/${artifact}/${version}/${artifact}-${version}
16-
remote_file=${url}.pack.gz
12+
url=https://github.com/bodar/${artifact}/releases/download/${version}/${artifact}-${version}.jar
1713
remote_sh=${url}.sh
1814

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

2117
if [ "$1" = "update" ]; then
22-
rm -f ${jar} ${pack}
18+
rm -f ${jar}
2319
fi
2420

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

0 commit comments

Comments
 (0)