-
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (90 loc) · 2.74 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
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
name: release
on:
release:
types:
- released
jobs:
build-assets:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
include:
- os: ubuntu-latest
alias: linux
- os: windows-latest
alias: win
name: Build on ${{ matrix.os }} and upload release assets
runs-on: ${{ matrix.os }}
steps:
# Checkout repo
- uses: actions/checkout@v3
# Install node
- uses: actions/setup-node@v3
with:
node-version: 20
# Install deps
- run: npm install --no-audit
# Package app
- name: Package for distribution
run: npm run pack-${{ matrix.alias }}
# Upload release assets
- name: Upload assets to release ${{ github.event.release.tag_name }}
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./package/artifacts/ufc-ripper-${{ matrix.alias }}-x64.zip
# Upload Linux build to artifacts
- if: matrix.os == 'ubuntu-latest'
name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: linux-assets
path: package/linux/
docker-publish:
name: Publish image to Docker Hub
needs: build-assets
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout
uses: actions/checkout@v3
# Download Linux build artifacts
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: linux-assets
path: package/linux/
# Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Authenticate Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build docker image and push to Docker Hub repo
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: |
m4heshd/ufc-ripper:${{ github.event.release.tag_name }}
m4heshd/ufc-ripper:latest
# Update Docker Hub repo description
- name: Update repo description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: m4heshd/ufc-ripper
readme-filepath: ./docker/README.md
short-description: ${{ github.event.repository.description }}