Skip to content

Commit

Permalink
chore: remove all upload methods except github releases
Browse files Browse the repository at this point in the history
They aren't used anywhere as far as I know.
  • Loading branch information
boredland authored May 7, 2024
1 parent cd098b4 commit 875d80c
Showing 1 changed file with 1 addition and 94 deletions.
95 changes: 1 addition & 94 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,9 @@ inputs:
description: 'specific build mirror to use'
required: false
default: https://mirror.easyname.at/manjaro
gpg-secret-key-base64:
description: 'base64 encoded gpg secret key (without a passphrase) to sign the zip (if set)'
required: false
gpg-passphrase:
description: 'phrase to decrypt the gpg secret key if given'
required: false
additional-trusted-gpg:
description: 'gpg keyids that pacman should trust'
required: false
cdn77-host:
description: 'cdn77 upload credentials'
required: false
cdn77-user:
description: 'cdn77 upload credentials'
required: false
cdn77-pwd:
description: 'cdn77 upload credentials'
required: false
sf-project:
description: 'sf upload credentials'
required: false
sf-user:
description: 'sf upload credentials'
required: false
sf-key:
description: 'sf upload credentials'
required: false
osdn-project:
description: 'osdn upload credentials'
required: false
osdn-user:
description: 'osdn upload credentials'
required: false
osdn-key:
description: 'osdn upload credentials'
required: false
s3-cfg:
description: 'S3 config'
required: false

outputs:
file-path:
Expand Down Expand Up @@ -280,17 +244,6 @@ runs:
sha1sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha1
sha256sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha256
sha512sum ${{ steps.image-build.outputs.file-path }} >${{ steps.image-build.outputs.file-path }}.sha512
- id: gpg_sign
shell: bash
run: |
# if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
if [ -z "${{ inputs.gpg-secret-key-base64 }}" ]; then
echo "## no gpg secret given"
exit 0
fi
echo "## gpg signing"
cat <(echo -e "${{ inputs.gpg-secret-key-base64 }}" | base64 --decode) | gpg --batch --import &>/dev/null
gpg --pinentry-mode loopback --passphrase "${{ inputs.gpg-passphrase }}" --detach-sign ./${{ steps.image-build.outputs.file-path }}
- id: upload-prepare
shell: bash -O extglob {0}
run: |
Expand All @@ -301,29 +254,6 @@ runs:
ssh-agent -a /tmp/ssh_agent.sock > /dev/null
echo "upload-files=./${{ steps.image-build.outputs.file-path }}+(|.sha*|.pkgs|.sig|.torrent)" >> $GITHUB_OUTPUT
mkdir -p ${{ inputs.edition }}/${{ inputs.version }}
- name: upload-sourceforge
shell: bash -O extglob {0}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
# if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
if [ -z "${{ inputs.sf-project }}" ] || [ -z "${{ inputs.sf-user }}" ] || [ -z "${{ inputs.sf-key }}" ]; then
echo "## not (all) credentials given for sourceforge upload"
exit 0
fi
echo "## sourceforge upload"
ssh-keyscan -t rsa frs.sourceforge.net >> /home/runner/.ssh/known_hosts
echo "${{ inputs.sf-key }}" >> /home/runner/.ssh/github_actions
ssh-add /home/runner/.ssh/github_actions
## create target dir
rsync -vaP --stats -e ssh ${{ inputs.edition }} \
${{ inputs.sf-user }}@frs.sourceforge.net:/home/frs/project/${{ inputs.sf-project }}/
## upload
rsync -vaP --stats -e ssh ${{ steps.upload-prepare.outputs.upload-files }} \
${{ inputs.sf-user }}@frs.sourceforge.net:/home/frs/project/${{ inputs.sf-project }}/${{ inputs.edition }}/${{ inputs.version }}/
- id: upload-github-release
shell: bash -O extglob {0}
env:
Expand Down Expand Up @@ -353,27 +283,4 @@ runs:
gh release upload ${{ inputs.release-tag }} --repo ${{ github.repository }} --clobber \
./${{ steps.image-build.outputs.file-path }}+(.z*|.sha*|.pkgs|.sig|.torrent)
fi
- name: upload-cdn77-s3
shell: bash -O extglob {0}
run: |
# if is not yet supported in composite https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md#if-condition
if [ -z "${{ inputs.s3-cfg }}" ]; then
echo "## credentials for cdn77 S3 upload not provided. Skipping."
exit 0
fi
echo "## create torrent"
mktorrent -v -a udp://tracker.opentrackr.org:1337 -l 21 \
-w "https://download.manjaro.org/${{ inputs.edition }}/${{ inputs.version }}/${{ steps.image-build.outputs.file-path }}" \
-o ${{ steps.image-build.outputs.file-path }}.torrent ${{ steps.image-build.outputs.file-path }}
echo "## cdn77 S3 upload"
# copy config
echo "${{ inputs.s3-cfg }}" > /home/runner/.s3cfg
# create bash array and mv files to dir
upload_files=( "${{ steps.upload-prepare.outputs.upload-files }}" )
for f in ${upload_files[@]}; do
mv ${f} "${{ inputs.edition }}/${{ inputs.version }}/"
done
# upload
s3cmd sync --progress --recursive -F "${{ inputs.edition }}" s3://s3downloadseu/

0 comments on commit 875d80c

Please sign in to comment.