Skip to content

Commit

Permalink
secrets to environmnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmx committed Jun 26, 2024
1 parent b7cfa05 commit 209bae5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/make_and_publish_pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ on:
- amd64
jobs:
make-packages:
env:
APTLY_API_USER: ${{secrets.APTLY_API_USER}}
APTLY_API_PASS: ${{secrets.APTLY_API_PASS}}
APTLY_GPG_PASSPHRASE: ${{secrets.APTLY_GPG_PASSPHRASE}}
uses: AllStarLink/asl3-update-nodelist/.github/workflows/ephemeral_ec2_run-this.yml@develop
with:
run-this: ./builder/dockerbuild.sh -a ${{ inputs.arch }} -o ${{ inputs.os }} --gh-rel ${{ inputs.gh-rel }} -r ${{ inputs.aptly-repo }} -u ${{secrets.APTLY_API_USER}}:${{secrets.APTLY_API_PASS}} -g ${{secrets.APTLY_GPG_PASSPHRASE}}
run-this: ./builder/dockerbuild.sh -a ${{ inputs.arch }} -o ${{ inputs.os }} --gh-rel ${{ inputs.gh-rel }} -r ${{ inputs.aptly-repo }}
arch: ${{ inputs.arch == 'armhf' && 'arm64' || inputs.arch == 'aarch64' && 'arm64' || inputs.arch == 'amd64' && 'x86_64' || inputs.arch == 'riscv64' && 'x86_64' || inputs.arch }}
artifact-path: '/actions-runner/_work/asl3-update-nodelist/_debs/'
secrets: inherit
14 changes: 3 additions & 11 deletions builder/dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ while [[ $# -gt 0 ]]; do
APTLY_REPO="asl-$2"
shift
shift
;;
-u)
APTLY_USER="$2"
shift
shift
;;
-g)
APTLY_GPG="$2"
shift
shift
;;
-*|--*|*)
echo "Unknown option $1"
Expand Down Expand Up @@ -105,6 +95,8 @@ gh release upload -R AllStarLink/asl3-update-nodelist $GH_REL $ALL_PKG_ROOT/_deb

docker image rm --force $D_TAG

APTLY_USER="${APTLY_API_USER}:${APTLY_API_PASS}"

find $GH_REL $ALL_PKG_ROOT/_debs/*.deb -name "*.deb" | \
xargs -I {} -d '\n' curl --fail --user ${APTLY_USER} \
-X POST -F 'file=@"{}"' \
Expand All @@ -114,6 +106,6 @@ curl --fail --user ${APTLY_USER} -X POST \
https://repo-admin.allstarlink.org/api/repos/${APTLY_REPO}/file/${APTLY_REPO}-${OPERATING_SYSTEMS}

curl --fail --user ${APTLY_USER} -X PUT -H "content-Type: application/json" \
--data '{"Signing": {"Batch": true, "Passphrase": "${APTLY_GPG}"}}' \
--data '{"Signing": {"Batch": true, "Passphrase": "${APTLY_GPG_PASSPHRASE}"}}' \
"https://repo-admin.allstarlink.org/api/publish/:./${OPERATING_SYSTEMS}"

0 comments on commit 209bae5

Please sign in to comment.