-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (46 loc) · 1.52 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
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: 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"