-
Notifications
You must be signed in to change notification settings - Fork 27
140 lines (134 loc) · 5.86 KB
/
build-release-latest.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: build-release-latest
on:
push:
tags-ignore: 'v*'
branches: '**'
env:
release: stable
repo_dir: dhcpy6d-jekyll/docs/repo
jobs:
build-debian:
runs-on: ubuntu-latest
env:
dist: debian
steps:
# get source
- uses: actions/checkout@v2
# build container image for package creation
- run: /usr/bin/docker build -t build-${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/*.sh
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
build-${{ github.job }}
# upload results
- uses: actions/upload-artifact@v2
with:
path: ./*.deb
retention-days: 1
build-centos:
runs-on: ubuntu-latest
env:
dist: centos
steps:
# get source
- uses: actions/checkout@v2
# build container image for package creation
- run: /usr/bin/docker build -t build-${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/*.sh
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
build-${{ github.job }}
# upload results
- uses: actions/upload-artifact@v2
with:
path: ./*.rpm
retention-days: 1
repo-debian:
runs-on: ubuntu-latest
needs: [build-debian]
env:
dist: debian
steps:
- uses: actions/checkout@v2
# get binaries created by other jobs
- uses: actions/download-artifact@v2
# build container image for repo packaging, using the same as for building
- run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/entrypoint-*.sh
# get secret signing key
- run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc
# organize SSH deploy key for dhcp6d-jekyll repo
- run: mkdir ~/.ssh
- run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519
- run: chmod -R go-rwx ~/.ssh
# get and prepare dhcpy6d-jekyll
- run: git clone [email protected]:HenriWahl/dhcpy6d-jekyll.git
- run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
- run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
--env RELEASE=${{ env.release }} \
${{ github.job }}
# commit and push new binaries to dhcpyd-jekyll
- run: git config --global user.email "[email protected]" && git config --global user.name "Dhcpy6d Repository"
- run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push
repo-centos:
runs-on: ubuntu-latest
# has to wait for repo-debian to avoid parallel processing of git repo dhcpy6d-jekyll
needs: [build-centos, repo-debian]
env:
dist: centos
steps:
- uses: actions/checkout@v2
# get binaries created by other jobs
- uses: actions/download-artifact@v2
# build container image for repo packaging, using the same as for building
- run: /usr/bin/docker build -t ${{ github.job }} -f build/Dockerfile-${{ env.dist }} .
# make entrypoints executable
- run: chmod +x build/entrypoint-*.sh
# get secret signing key
- run: echo "${{ secrets.DHCPY6D_SIGNING_KEY }}" > signing_key.asc
# organize SSH deploy key for dhcp6d-jekyll repo
- run: mkdir ~/.ssh
- run: echo "${{ secrets.DHCPY6D_REPO_SSH_KEY }}" > ~/.ssh/id_ed25519
- run: chmod -R go-rwx ~/.ssh
# get and prepare dhcpy6d-jekyll
- run: git clone [email protected]:HenriWahl/dhcpy6d-jekyll.git
- run: rm -rf ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
- run: mkdir -p ${{ env.repo_dir }}/${{ env.release }}/${{ env.dist }}
# execute container with matching entrypoint
- run: |
/usr/bin/docker run --volume ${{ github.workspace }}:/dhcpy6d \
--volume ${{ github.workspace }}/build/entrypoint-${{ github.job }}.sh:/entrypoint.sh \
--entrypoint /entrypoint.sh \
--env RELEASE=${{ env.release }} \
${{ github.job }}
# commit and push new binaries to dhcpyd-jekyll
- run: git config --global user.email "[email protected]" && git config --global user.name "Dhcpy6d Repository"
- run: cd ${{ env.repo_dir }} && git add . && git commit -am "new ${{ env.release }} repo ${{ env.dist }}" && git push
github-release:
runs-on: ubuntu-latest
needs: [build-debian, build-centos]
steps:
- uses: actions/download-artifact@v2
- run: cd artifact && md5sum *dhcpy6d* > md5sums.txt
- run: cd artifact && sha256sum *dhcpy6d* > sha256sums.txt
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
files: |
artifact/*