Skip to content

Merge pull request #5 from toltec-dev/Eeems-patch-1 #21

Merge pull request #5 from toltec-dev/Eeems-patch-1

Merge pull request #5 from toltec-dev/Eeems-patch-1 #21

Workflow file for this run

name: release
on:
push:
tags:
- '*'
branches:
- main
pull_request:
jobs:
build:
name: Build the wget binary
runs-on: ubuntu-latest
container:
image: ghcr.io/toltec-dev/base:v1.2
steps:
- name: Checkout the Git repository
uses: actions/checkout@v4
- name: Build the binary
run: ./build
- name: Store the resulting artifact
uses: actions/upload-artifact@v4
with:
name: wget
path: /root/wget
build-aarch64:
name: Build the wget binary aarch64
runs-on: ubuntu-latest
container:
image: ghcr.io/toltec-dev/base:v4.0
steps:
- name: Checkout the Git repository
uses: actions/checkout@v4
- name: Build the binary
run: |
bash -c 'source /opt/x-tools/switch-aarch64.sh; ./build'
mv /root/wget /root/wget-aarch64
- name: Store the resulting artifact
uses: actions/upload-artifact@v4
with:
name: wget-aarch64
path: /root/wget-aarch64
release:
name: Publish the wget binary
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Fetch the built binary
uses: actions/download-artifact@v4
with:
name: wget
- name: Fetch the built aarch64 binary
uses: actions/download-artifact@v4
with:
name: wget-aarch64
- name: Transfer packages and index
run: |
mkdir -p private
chmod 700 private
echo "${{ secrets.SSH_PRIVATE_KEY }}" > private/id_rsa
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > private/known_hosts
chmod 600 private/*
version="$(echo "${{ github.ref }}" | cut -d / -f 3)"
scp -P "${{ secrets.SSH_PORT }}" \
-i private/id_rsa \
-o UserKnownHostsFile=private/known_hosts \
wget "${{ secrets.REMOTE_SSH }}":/srv/toltec/thirdparty/bin/wget-"$version"
scp -P "${{ secrets.SSH_PORT }}" \
-i private/id_rsa \
-o UserKnownHostsFile=private/known_hosts \
wget-aarch64 "${{ secrets.REMOTE_SSH }}":/srv/toltec/thirdparty/bin/wget-aarch64-"$version"