2022-08-11 20:22:39 +00:00
|
|
|
name: ci-build
|
|
|
|
on:
|
2022-09-06 07:41:49 +00:00
|
|
|
push:
|
2023-03-08 14:18:05 +00:00
|
|
|
branches:
|
|
|
|
- '**'
|
2022-10-30 16:37:39 +00:00
|
|
|
workflow_dispatch:
|
2022-08-11 20:22:39 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-08-21 17:31:16 +00:00
|
|
|
build:
|
2022-08-11 20:22:39 +00:00
|
|
|
name: Build
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-08-11 20:38:49 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-30 17:09:55 +00:00
|
|
|
- run: |
|
2022-10-30 17:11:13 +00:00
|
|
|
git fetch --force --tags
|
2023-03-06 14:50:36 +00:00
|
|
|
|
|
|
|
- name: Setup Golang with cache
|
|
|
|
uses: magnetikonline/action-golang-cache@v3
|
|
|
|
with:
|
|
|
|
go-version-file: go.mod
|
2022-08-21 17:31:16 +00:00
|
|
|
|
2023-03-08 14:18:05 +00:00
|
|
|
- name: Install SSH Key
|
|
|
|
if: ${{ env.SSH_PRIVATE_KEY != '' }}
|
|
|
|
uses: shimataro/ssh-key-action@v2
|
|
|
|
with:
|
|
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
|
2022-09-04 14:30:20 +00:00
|
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
2023-03-08 14:18:05 +00:00
|
|
|
if: ${{ env.REPO_KEY != '' }}
|
2022-09-04 14:30:20 +00:00
|
|
|
with:
|
|
|
|
packages: git-crypt xxd
|
|
|
|
version: 1.0
|
2023-03-08 14:18:05 +00:00
|
|
|
env:
|
|
|
|
REPO_KEY: ${{ secrets.REPO_KEY }}
|
2022-09-04 14:30:20 +00:00
|
|
|
|
2022-08-12 17:55:51 +00:00
|
|
|
- name: decrypt
|
2023-03-08 14:18:05 +00:00
|
|
|
if: ${{ env.REPO_KEY != '' }}
|
2022-08-12 17:55:51 +00:00
|
|
|
run: |
|
|
|
|
echo ${REPO_KEY} | xxd -r -p > ../bedrock-repo-key.key
|
|
|
|
git-crypt unlock ../bedrock-repo-key.key
|
|
|
|
rm ../bedrock-repo-key.key
|
|
|
|
env:
|
|
|
|
REPO_KEY: ${{ secrets.REPO_KEY }}
|
2023-03-06 01:03:31 +00:00
|
|
|
|
2023-03-06 01:05:33 +00:00
|
|
|
- run: go install github.com/fyne-io/fyne-cross@latest
|
2022-09-04 14:28:09 +00:00
|
|
|
- run: go get ./cmd/bedrocktool
|
2022-08-11 20:22:39 +00:00
|
|
|
|
2022-08-21 17:31:16 +00:00
|
|
|
- name: build
|
2022-10-30 16:49:54 +00:00
|
|
|
id: build
|
2023-03-06 14:50:36 +00:00
|
|
|
run: python build.py
|
2022-09-05 21:57:11 +00:00
|
|
|
|
|
|
|
- name: Deploy with rsync
|
2023-03-08 14:18:05 +00:00
|
|
|
if: ${{ env.SSH_HOST != '' }}
|
|
|
|
run: rsync -avz ./updates/ olebeck@${SSH_HOST}:/var/www/updates/
|
|
|
|
env:
|
|
|
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
2022-12-15 19:21:33 +00:00
|
|
|
|
2022-09-04 11:22:34 +00:00
|
|
|
- uses: "marvinpinto/action-automatic-releases@latest"
|
2022-08-21 17:31:16 +00:00
|
|
|
with:
|
2022-09-04 11:21:18 +00:00
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
2023-03-08 14:18:05 +00:00
|
|
|
automatic_release_tag: ${{ steps.build.outputs.release_tag }}
|
2023-03-06 01:03:31 +00:00
|
|
|
files: ./builds/*
|
2022-09-04 11:27:17 +00:00
|
|
|
prerelease: false
|