Skip to content

Commit

Permalink
Revert ":fire: remove all upload methods (keep gh releases) (#63)"
Browse files Browse the repository at this point in the history
This reverts commit 4a9d54e.
  • Loading branch information
philmmanjaro committed May 7, 2024
1 parent 4a9d54e commit d08140e
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/cleanup-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,39 @@ jobs:
gh release delete ${{ env.version }} -y --repo ${{ github.repository }}
git push --delete origin ${{ env.version }}
- name: ssh-prepare
if: always()
run: |
mkdir -p /home/runner/.ssh
touch /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a /tmp/ssh_agent.sock > /dev/null
- name: delete cdn77 test upload
if: always()
run: |
ssh-keyscan -t rsa ${{ secrets.CDN_HOST }} >> /home/runner/.ssh/known_hosts
sshpass -p "${{ secrets.CDN_PWD }}" rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.CDN_USER }}@${{ secrets.CDN_HOST }}:/www/${{ env.edition }}/${{ env.version }}
- name: delete sourceforge test upload
if: always()
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-keyscan -t rsa frs.sourceforge.net >> /home/runner/.ssh/known_hosts
echo "${{ secrets.SF_PRIV_SSHKEY }}" >> /home/runner/.ssh/github_actions
ssh-add /home/runner/.ssh/github_actions
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.SF_USER_NAME }}@frs.sourceforge.net:/home/frs/project/manjarolinux/${{ env.edition }}/${{ env.version }}
- name: delete osdn test upload
if: always()
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-keyscan -t rsa storage.osdn.net >> /home/runner/.ssh/known_hosts
echo "${{ secrets.OSDN_PRIV_SSHKEY }}" >> /home/runner/.ssh/github_actions
ssh-add /home/runner/.ssh/github_actions
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.OSDN_USER_NAME }}@storage.osdn.net:/storage/groups/m/ma/manjaro/${{ env.edition }}/${{ env.version }}
18 changes: 15 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
matrix:
##### EDIT ME #####
EDITION: [xfce]
BRANCH: [unstable]
BRANCH: [stable]
SCOPE: [minimal]
###################
steps:
Expand All @@ -42,6 +42,18 @@ jobs:
scope: ${{ matrix.scope }}
version: ${{ env.version }}
release-tag: ${{ env.version }}
gpg-secret-key-base64: ${{ secrets.CI_PRIV_KEY }}
gpg-passphrase: ${{ secrets.CI_GPG_PASSPHRASE }}
gpg-secret-key-base64: ${{ secrets.gpg_secret_base64 }}
gpg-passphrase: 1234
cdn77-host: ${{ secrets.CDN_HOST }}
cdn77-user: ${{ secrets.CDN_USER }}
cdn77-pwd: ${{ secrets.CDN_PWD }}
sf-project: manjarolinux
sf-user: ${{ secrets.SF_USER_NAME }}
sf-key: ${{ secrets.SF_PRIV_SSHKEY }}
# custom-repo:
office-chooser: true
build-mirror: ${{ secrets.BUILD_MIRROR }}
# osdn is absurdly slow sometimes
# osdn-project: manjaro
# osdn-user: ${{ secrets.OSDN_USER_NAME }}
# osdn-key: ${{ secrets.OSDN_PRIV_SSHKEY }}
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,58 @@ all distribution channels can be configured by setting / leaving out of their co
gh release delete ${{ needs.prepare-release.outputs.release_tag }} -y --repo ${{ github.repository }}
git push --delete origin ${{ needs.prepare-release.outputs.release_tag }}
```
### cdn77 release
```yaml
- id: image-build
uses: manjaro/manjaro-iso-action@main
with:
...
cdn77-host: ${{ secrets.CDN_HOST }}
cdn77-user: ${{ secrets.CDN_USER }}
cdn77-pwd: ${{ secrets.CDN_PWD }}
- name: rollback cdn77 upload
if: ${{ failure() || cancelled() }}
run: |
sshpass -p "${{ secrets.CDN_PWD }}" rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.CDN_USER }}@${{ secrets.CDN_HOST }}:/www/${{ env.edition }}/${{ env.version }}
```
### SourceForge release
```yaml
- id: image-build
uses: manjaro/manjaro-iso-action@main
with:
...
sf-project: manjarolinux
sf-user: ${{ secrets.SF_USER_NAME }}
sf-key: ${{ secrets.SF_PRIV_SSHKEY }}
- name: rollback sourceforge upload
if: ${{ failure() || cancelled() }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.SF_USER_NAME }}@frs.sourceforge.net:/home/frs/project/manjarolinux/${{ env.edition }}/${{ env.version }}
```
### osdn release
```yaml
- id: image-build
uses: manjaro/manjaro-iso-action@main
with:
...
osdn-project: manjaro
osdn-user: ${{ secrets.OSDN_USER_NAME }}
osdn-key: ${{ secrets.OSDN_PRIV_SSHKEY }}
- name: rollback osdn upload
if: ${{ failure() || cancelled() }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
rsync --delete -vaP --stats \
-e ssh $(mktemp) ${{ secrets.OSDN_USER_NAME }}@storage.osdn.net:/storage/groups/m/ma/manjaro/${{ env.edition }}/${{ env.version }}
```
78 changes: 77 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,36 @@ inputs:
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 @@ -271,6 +301,29 @@ 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 @@ -300,4 +353,27 @@ 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 d08140e

Please sign in to comment.