Skip to content

Commit

Permalink
Switch toolchain to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Jan 25, 2021
1 parent deabae4 commit 2d0120e
Show file tree
Hide file tree
Showing 13 changed files with 338 additions and 157 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*

!rootfs/
!Dockerfile
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ indent_size = 4
indent_style = tab
indent_size = 4

[{*.sh,*.bats,post_push,post_push.tmpl.php}]
[*.{sh,bats}]
indent_style = space
indent_size = 2

Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

on:
pull_request:
push:
schedule:
- cron: '0 10 * * 5'

env:
PUBLISH: ${{ github.event_name == 'push'
&& (startsWith(github.ref, 'refs/tags/0')
|| startsWith(github.ref, 'refs/tags/1')
|| startsWith(github.ref, 'refs/tags/2')
|| startsWith(github.ref, 'refs/tags/3')
|| startsWith(github.ref, 'refs/tags/4')
|| startsWith(github.ref, 'refs/tags/5')
|| startsWith(github.ref, 'refs/tags/6')
|| startsWith(github.ref, 'refs/tags/7')
|| startsWith(github.ref, 'refs/tags/8')
|| startsWith(github.ref, 'refs/tags/9')) }}

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1

- uses: satackey/[email protected]
continue-on-error: true
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}
- run: make docker.image no-cache=no tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH != 'true' && github.ref != 'refs/heads/master' }}

- run: make docker.image no-cache=yes tag=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' || github.ref == 'refs/heads/master' }}

- run: make npm.install
- run: make test.docker tag=build-${{ github.run_number }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GCR_BOT_PAT }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: instrumentisto+bot
password: ${{ secrets.QUAYIO_ROBOT_TOKEN }}
if: ${{ env.PUBLISH == 'true' }}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: instrumentistobot
password: ${{ secrets.DOCKERHUB_BOT_PASS }}
if: ${{ env.PUBLISH == 'true' }}

- run: make docker.tags of=build-${{ github.run_number }}
if: ${{ env.PUBLISH == 'true' }}
- run: make docker.push
if: ${{ env.PUBLISH == 'true' }}

# On GitHub Container Registry README is automatically updated on pushes.
- name: Update README on Quay.io
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_APIKEY: ${{ secrets.QUAYIO_API_TOKEN }}
with:
provider: quay
destination_container_repo: quay.io/instrumentisto/pure-ftpd
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}
- name: Update README on Docker Hub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: instrumentistobot
DOCKER_PASS: ${{ secrets.DOCKERHUB_BOT_PASS }}
with:
provider: dockerhub
destination_container_repo: instrumentisto/pure-ftpd
readme_file: README.md
if: ${{ env.PUBLISH == 'true' }}

- name: Parse release version from Git tag
id: release
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
if: ${{ env.PUBLISH == 'true' }}
- name: Parse CHANGELOG link
id: changelog
run: echo ::set-output name=LINK::https://github.com/${{ github.repository }}/blob/${{ steps.release.outputs.VERSION }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)
if: ${{ env.PUBLISH == 'true' }}
- name: Release on GitHub
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release.outputs.VERSION }}
release_name: ${{ steps.release.outputs.VERSION }}
body: |
[Changelog](${{ steps.changelog.outputs.LINK }})
if: ${{ env.PUBLISH == 'true' }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/.idea/
*.iml
/*.iml
.DS_Store

/node_modules/
/package-lock.json
/yarn.lock
/yarn-error.log
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Pure-FTPd image changelog
=========================

All user visible changes to this project will be documented in this file. This project uses [Semantic Versioning 2.0.0].




## [1.0.49-r0] · 2021-01-25
[1.0.49-r0]: /../../tree/1.0.49-r0

[Diff](/../../compare/1.0.48...1.0.49-r0)

### Upgraded

- [Pure-FTPd] 1.0.49: <https://github.com/jedisct1/pure-ftpd/releases/tag/1.0.49>
- [s6-overlay] 2.0.0.1: <https://github.com/just-containers/s6-overlay/releases/tag/v2.0.0.1>
- [Alpine Linux] 3.12: <https://www.alpinelinux.org/posts/Alpine-3.12.0-released.html>




## Previous releases

See [GitHub releases](/../../releases).





[Alpine Linux]: https://www.alpinelinux.org
[Pure-FTPd]: https://github.com/jedisct1/pure-ftpd
[s6-overlay]: https://github.com/just-containers/s6-overlay
[Semantic Versioning 2.0.0]: https://semver.org
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# https://hub.docker.com/_/alpine
FROM alpine:3.12

ARG pure_ftpd_ver=1.0.49
ARG s6_overlay_ver=2.0.0.1
ARG build_rev=0

LABEL org.opencontainers.image.source="\
https://github.com/instrumentisto/pure-ftpd-docker-image"


# Build and install Pure-FTPd
RUN apk update \
Expand All @@ -25,7 +32,7 @@ RUN apk update \
\
# Download and prepare Pure-FTPd sources
&& curl -fL -o /tmp/pure-ftpd.tar.gz \
https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.49.tar.gz \
https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${pure_ftpd_ver}.tar.gz \
&& (echo "7e7d4c81c5237624051bde53db6d9abcbae565a4e8a88627d81d369064b475f4b56305c105ed275264cce068844caad25b2014f41e2540058553222151fe3af8 /tmp/pure-ftpd.tar.gz" \
| sha512sum -c -) \
&& tar -xzf /tmp/pure-ftpd.tar.gz -C /tmp/ \
Expand Down Expand Up @@ -71,7 +78,7 @@ RUN apk update \
RUN apk add --update --no-cache --virtual .tool-deps \
curl \
&& curl -fL -o /tmp/s6-overlay.tar.gz \
https://github.com/just-containers/s6-overlay/releases/download/v2.0.0.1/s6-overlay-amd64.tar.gz \
https://github.com/just-containers/s6-overlay/releases/download/v${s6_overlay_ver}/s6-overlay-amd64.tar.gz \
&& tar -xzf /tmp/s6-overlay.tar.gz -C / \
\
# Cleanup unnecessary stuff
Expand Down
Loading

0 comments on commit 2d0120e

Please sign in to comment.