Merge pull request #65 from HenriWahl/option_82 #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-release-stable | |
on: | |
push: | |
tags: 'v*' | |
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 }}" | |
prerelease: true | |
files: | | |
artifact/* |