Skip to content

Commit

Permalink
Only deploy releases to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Jan 4, 2024
1 parent eb476b3 commit 7904e14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jobs:
shell: bash
run: |
sed "s/{USERNAME}/${GITHUB_ACTOR}/g; s/{TOKEN}/${{ secrets.GITHUB_TOKEN }}/g" mx.trufflesqueak/mvn-settings.xml.template > mx.trufflesqueak/mvn-settings.xml
mx --env trufflesqueak-jar maven-deploy --settings mx.trufflesqueak/mvn-settings.xml --version-string 24.0.0-SNAPSHOT --validate full --licenses MIT --suppress-javadoc github https://maven.pkg.github.com/hpi-swa/trufflesqueak
mx.trufflesqueak/utils.sh conditional-deploy \
mx --env trufflesqueak-jar maven-deploy --settings mx.trufflesqueak/mvn-settings.xml --version-string ${{ github.ref_name }} --validate full --licenses MIT --suppress-javadoc github https://maven.pkg.github.com/hpi-swa/trufflesqueak
if: ${{ matrix.os == 'ubuntu-20.04' }}
- name: Run SystemReporter on TruffleSqueak
run: 'trufflesqueak --code "(String streamContents: [:s | SystemReporter basicNew reportImage: s; reportVM: s; reportVMParameters: s]) withUnixLineEndings" images/test-64bit.image'
Expand Down
12 changes: 11 additions & 1 deletion mx.trufflesqueak/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ build-standalone() {
echo "[${standalone_home}/bin added to \$PATH]"
}

deploy-asset() {
check-deploy() {
local git_tag=$(git tag --points-at HEAD)
if [[ -z "${git_tag}" ]]; then
echo "Skipping deployment step (commit not tagged)"
Expand All @@ -87,6 +87,15 @@ deploy-asset() {
echo "Skipping deployment step (tag ${git_tag} does not start with a digit)"
exit 0
fi
}

conditional-deploy() {
check-deploy
eval "$@"
}

deploy-asset() {
check-deploy
local filename=$1
if [[ "${filename}" == *.tar ]]; then
echo "Compressing tarball..."
Expand All @@ -96,6 +105,7 @@ deploy-asset() {
# zip files are always compressed because mx_trufflesqueak.py forces localCompress

local auth="Authorization: token $2"
local git_tag=$(git tag --points-at HEAD)
local release_id

tag_result=$(curl -L --retry 3 --retry-connrefused --retry-delay 2 -sH "${auth}" \
Expand Down

0 comments on commit 7904e14

Please sign in to comment.