Skip to content

Commit

Permalink
ci: upload artifacts step
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Feb 4, 2025
1 parent 35dbe81 commit 7480109
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ jobs:
if: ${{ inputs.additional-setup != '' }}
run: ${{ inputs.additional-setup }}

- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Run Tests (Native Only)
run: cargo test
38 changes: 32 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ jobs:
fi
cargo install cargo-generate-rpm cargo-deb
- name: Rust cache
uses: Swatinem/rust-cache@v2

- name: Cargo Fetch
run: cargo fetch

- name: Build Cross (${{ matrix.arch }})
if: matrix.arch != runner.arch
run: cargo build --release --target=${{ matrix.arch }}-unknown-linux-gnu
Expand Down Expand Up @@ -259,3 +253,35 @@ jobs:
name: DamusNotedeckInstaller-${{ matrix.arch }}.exe
path: packages\${{ matrix.arch }}\DamusNotedeckInstaller.exe

upload-artifacts:
name: Upload Artifacts to Server
runs-on: ubuntu-20.04
needs: [packaging, macos-dmg, windows-installer]
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/ci'

steps:
- name: Download all Artifacts
uses: actions/download-artifact@v4

- name: Setup SSH and Upload
run: |
eval "$(ssh-agent -s)"
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.DEPLOY_SFTP_KEY }}" | tr -d '\r' | ssh-add -
echo "${{ secrets.DEPLOY_IP }} ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEN65pj1cNMqlf96jZLr1i9+mnHIN4jjRPPTDix6sRnt" >> ~/.ssh/known_hosts
ls -la /home/runner/work/notedeck/notedeck/notedeck-x86_64.rpm
export ARTIFACTS=/home/runner/work/notedeck/notedeck
sftp ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_IP }} <<EOF
cd upload/artifacts
put $ARTIFACTS/notedeck-x86_64.rpm/*
put $ARTIFACTS/notedeck-x86_64.deb/*
put $ARTIFACTS/notedeck-x86_64.dmg/*
put $ARTIFACTS/notedeck-aarch64.rpm/*
put $ARTIFACTS/notedeck-aarch64.deb/*
put $ARTIFACTS/notedeck-aarch64.dmg/*
put $ARTIFACTS/DamusNotedeckInstaller-x86_64.exe/*
put $ARTIFACTS/DamusNotedeckInstaller-aarch64.exe/*
bye
EOF

0 comments on commit 7480109

Please sign in to comment.