GitHub Actions - update autoRelease.yml #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
name: "[master] Validate, Build & Release" | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
Sanity: | ||
Check failure on line 10 in .github/workflows/autoRelease.yml GitHub Actions / [master] Validate, Build & ReleaseInvalid workflow file
|
||
name: Build & Sanity Check | ||
needs: eslint | ||
strategy: | ||
matrix: | ||
runs-on: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.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-${{ matrix.runs-on }} | ||
- name: Test Build Binaries | ||
run: pnpm run test-${{ matrix.runs-on }} | ||
- name: Upload Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-${{ matrix.runs-on }} | ||
path: ./build/ | ||
# 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 build on GitHub | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
automatic_release_tag: latest | ||
draft: true | ||
title: Latest Release | ||
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 QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- 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:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: linux/amd64,linux/arm64 |