-
-
Notifications
You must be signed in to change notification settings - Fork 45
136 lines (109 loc) · 3.19 KB
/
autoDev.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: "[dev] Validate & Build"
on:
push:
branches:
- "dev"
pull_request:
types: ["opened", "edited", "reopened", "synchronize", "ready_for_review", "review_requested"]
jobs:
# eslint Check
eslint:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-eslint@v1
with:
reporter: github-check
eslint_flags: src/
github_token: ${{ secrets.GITHUB_TOKEN }}
# Binary Build & Test (depends on eslint)
Sanity:
name: Build & Sanity Check - ${{ matrix.platform.os-name }}
needs: eslint
strategy:
matrix:
platform:
- os-name: linux-x86_64
runs-on: ubuntu-latest
- os-name: windows-x86_64
runs-on: windows-latest
- os-name: macOS-x86_64
runs-on: macOS-13
- os-name: macOS-aarch64
runs-on: macOS-latest
runs-on: ${{ matrix.platform.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Install pnpm 📥
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install Node.js 📥
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: latest
- name: Install dependencies 📥
run: pnpm install
- name: Test ESM
run: pnpm run test-esm
- name: Build Binaries
run: pnpm run build
- name: Rename Float for Windows
run: mv ./build/float ./build/float.exe
if: matrix.platform.runs-on == 'windows-latest'
- name: Test Build Binaries
run: pnpm run test
- name: Make artifacts output dir
run: mkdir ./artifacts
- name: Archive binary
run: strip ./build/float && tar -czf ./artifacts/${{ matrix.platform.os-name }}.tar.gz -C ./build float
if: matrix.platform.runs-on != 'windows-latest'
- name: Archive binary (windows)
run: powershell -Command "Compress-Archive -Path './build/float.exe' -DestinationPath './artifacts/${{ matrix.platform.os-name }}.zip'"
if: matrix.platform.runs-on == 'windows-latest'
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.runs-on }}
path: ./artifacts/
# Release to GitHub (runs after tests)
Release:
name: Release dev build on GitHub
needs: Sanity
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: ./build/
merge-multiple: true
- name: Publish dev release on GitHub
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: dev
prerelease: true
title: Latest
files: build/*
# Release to DockerHub (runs after tests)
DockerHub:
name: Publish dev build to DockerHub
needs: Sanity
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build & Publish dev on DockerHub
uses: docker/build-push-action@v5
with:
push: true
tags: inrix/floatplane-downloader:dev
cache-from: type=gha
cache-to: type=gha,mode=max