-
-
Notifications
You must be signed in to change notification settings - Fork 20
87 lines (73 loc) · 2.25 KB
/
release.yaml
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
name: Make release
env:
UBUNTU_VERSION: "latest"
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: "."
steps:
- name: Checkout GitHub Action
uses: actions/checkout@main
- uses: actions/setup-go@v5
with:
go-version: "stable"
cache-dependency-path: |
src/go.sum
- name: Build
run: cd src && make prod
- name: "Run release script"
run: node scripts/docker-release.mjs ${{ github.ref_name }}
- name: "Release"
uses: softprops/action-gh-release@v1
with:
files: ./src/bin/*
name: Unchained ${{ github.ref_name}}
tag_name: ${{ github.ref_name }}
prerelease: false
push-store-image:
needs: build
runs-on: ubuntu-latest
defaults:
run:
working-directory: "."
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@main
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: "Login to GitHub Container Registry"
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Get Docker Tag
id: docker-tag
run: |
if echo "${{ steps.package-version.outputs.current-version }}" | grep -q rc; then \
echo "docker-tag=rc" >> $GITHUB_OUTPUT; \
else echo "docker-tag=latest" >> $GITHUB_OUTPUT; fi;
- name: Build and push
uses: docker/build-push-action@v2
with:
context: docker
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/kenshitech/unchained:${{ steps.docker-tag.outputs.docker-tag }}
ghcr.io/kenshitech/unchained:${{ github.ref_name }}
build-args: |
"UBUNTU_VERSION=${{ env.UBUNTU_VERSION }}"
"UNCHAINED_VERSION=${{ github.ref_name }}"