-
Notifications
You must be signed in to change notification settings - Fork 5
105 lines (91 loc) · 2.61 KB
/
releaser.yaml
File metadata and controls
105 lines (91 loc) · 2.61 KB
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
name: Releaser
on:
push:
branches:
- main
workflow_dispatch:
inputs:
runme_branch:
description: "runmedev/runme branch"
required: false
default: "main"
web_branch:
description: "runmedev/web branch"
required: false
default: "main"
dry_run:
description: "Run without pushing image"
type: boolean
required: false
default: false
schedule:
- cron: "0 * * * *"
pull_request:
paths:
- "releaser/**"
- ".github/workflows/releaser.yaml"
permissions:
contents: read
packages: write
concurrency:
group: releaser-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
releaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: releaser/go.mod
cache-dependency-path: releaser/go.sum
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install ko
run: |
go install github.com/google/ko@v0.17.1
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Build releaser
run: |
cd releaser
go build -o ../releaser-bin .
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run releaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RUNME_BRANCH="main"
WEB_BRANCH="main"
DRY_RUN="false"
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
if [ -n "${{ github.event.inputs.runme_branch }}" ]; then
RUNME_BRANCH="${{ github.event.inputs.runme_branch }}"
fi
if [ -n "${{ github.event.inputs.web_branch }}" ]; then
WEB_BRANCH="${{ github.event.inputs.web_branch }}"
fi
if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
DRY_RUN="true"
fi
fi
if [ "${{ github.event_name }}" = "pull_request" ]; then
DRY_RUN="true"
fi
./releaser-bin \
--runme="${RUNME_BRANCH}" \
--web="${WEB_BRANCH}" \
--dry-run="${DRY_RUN}"