Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(artifacts): upload build artifacts with in-tree script #2158

Merged
merged 6 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .docker/Dockerfile.ci-container
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ RUN apt-get install -y \
gnupg \
git \
zip \
python3 \
python3-pip \
python-dev \
libffi-dev \
sudo

RUN ln -s /usr/bin/python3 /bin/python
RUN pip3 install --upgrade pip
RUN pip3 install paramiko

RUN apt install -y \
software-properties-common \
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/deps-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,14 @@ runs:
run: |
sudo apt-get update -y
sudo apt-get install -y libudev-dev

- name: Install python3
uses: actions/setup-python@v5
if: contains(inputs.deps, 'python3')
with:
python-version: 3

- name: Install `paramiko` pip package
if: contains(inputs.deps, 'paramiko')
shell: bash
run: pip install paramiko
152 changes: 60 additions & 92 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,14 @@ jobs:
zip $NAME target/release/kdf -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
mariocynicys marked this conversation as resolved.
Show resolved Hide resolved
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

- name: Login to dockerhub
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
Expand Down Expand Up @@ -113,7 +109,7 @@ jobs:
- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -151,18 +147,14 @@ jobs:
zip $NAME target/x86_64-apple-darwin/release/kdf -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

win-x86-64:
timeout-minutes: 60
Expand All @@ -177,7 +169,7 @@ jobs:
- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -217,18 +209,14 @@ jobs:
7z a $NAME .\target\release\kdf.exe .\target\release\*.dll
mv $NAME ./$Env:BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: garygrossgarten/github-action-scp@v0.8.0
with:
host: ${{ secrets.FILE_SERVER_HOST }}
username: ${{ secrets.FILE_SERVER_USERNAME }}
port: ${{ secrets.FILE_SERVER_PORT }}
privateKey: ${{ secrets.FILE_SERVER_KEY }}
local: ${{ env.BRANCH_NAME }}
remote: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

mac-dylib-x86-64:
timeout-minutes: 60
Expand All @@ -244,7 +232,7 @@ jobs:
- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -284,18 +272,14 @@ jobs:
zip $NAME target/x86_64-apple-darwin/release/libkdf.a -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

wasm:
timeout-minutes: 60
Expand Down Expand Up @@ -352,18 +336,14 @@ jobs:
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

ios-aarch64:
timeout-minutes: 60
Expand All @@ -379,7 +359,7 @@ jobs:
- name: Install build deps
uses: ./.github/actions/deps-install
with:
deps: ('protoc')
deps: ('protoc', 'python3', 'paramiko')

- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -419,18 +399,14 @@ jobs:
zip $NAME target/aarch64-apple-ios/release/libkdf.a -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

android-aarch64:
timeout-minutes: 60
Expand Down Expand Up @@ -500,18 +476,14 @@ jobs:
zip $NAME target/aarch64-linux-android/release/libkdf.a -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

android-armv7:
timeout-minutes: 60
Expand Down Expand Up @@ -581,18 +553,14 @@ jobs:
zip $NAME target/armv7-linux-androideabi/release/libkdf.a -j
mv $NAME ./$BRANCH_NAME/

- name: Upload output
- name: Upload build artifact
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
uses: easingthemes/ssh-deploy@v5.0.3
with:
REMOTE_HOST: ${{ secrets.FILE_SERVER_HOST }}
REMOTE_USER: ${{ secrets.FILE_SERVER_USERNAME }}
REMOTE_PORT: ${{ secrets.FILE_SERVER_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.FILE_SERVER_KEY }}
SOURCE: "${{ env.BRANCH_NAME }}/"
TARGET: "/uploads/${{ env.BRANCH_NAME }}"
FILE_SERVER_HOST: ${{ secrets.FILE_SERVER_HOST }}
FILE_SERVER_USERNAME: ${{ secrets.FILE_SERVER_USERNAME }}
FILE_SERVER_PORT: ${{ secrets.FILE_SERVER_PORT }}
FILE_SERVER_KEY: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.FILE_SERVER_KEY != '' }}
run: python3 ./scripts/ci/upload_artifact.py "${{ env.BRANCH_NAME }}" "/uploads/${{ env.BRANCH_NAME }}"

deployment-commitment:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
Expand Down
Loading
Loading