-
Notifications
You must be signed in to change notification settings - Fork 126
65 lines (61 loc) · 1.83 KB
/
release-publish.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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
ReleaseAssets:
runs-on: ubuntu-latest
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v2
- name: Docker Build
run: docker build . -f builder/Dockerfile -t builder:latest
- name: Run the Docker image
run: docker run --name=gdutils --rm -dit builder:latest bash
- name: Copy Built files
run: docker cp gdutils:/builder/ ./
- name: Compress Build Outputs
run: |
cd builder
mkdir build
tar --exclude='./build' -czf build/gdutils.tar.gz .
- uses: actions/upload-artifact@v2
with:
name: Build Location
path: builder/build/gdutils.tar.gz
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: GD-Utils Build ${{ steps.get_version.outputs.VERSION }}
files: |
builder/build/gdutils.tar.gz
DockerImage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/nenokkadine/gdutils
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: token
password: ${{ secrets.GH_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: baseimage/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}