Add release workflow
parent
24440a3151
commit
d42018550e
@ -0,0 +1,48 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
name: Release
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
env:
|
||||
DOCKER_REPO: ghcr.io/devplayer0/docker-net-dhcp
|
||||
PLATFORMS: linux/amd64,linux/386,linux/arm64,linux/arm/v7
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install script dependencies
|
||||
run: pip3 install -r scripts/requirements.txt
|
||||
|
||||
- id: vars
|
||||
name: Generate release vars
|
||||
run: |
|
||||
echo "::set-output name=version::"$(echo "${{ github.ref }}" | sed -r 's|refs/tags/v(.+)|\1|')""
|
||||
echo "Changelog: " > release.md
|
||||
git log --pretty=format:" - %s" "$(git describe --tags --abbrev=0 ${{ github.event.ref }}^)"..${{ github.event.ref }} >> release.md
|
||||
|
||||
- name: Tag with release
|
||||
env:
|
||||
REGISTRY_USERNAME: ${{ github.actor }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
scripts/tag_multiarch_plugin.py -p $PLATFORMS "$DOCKER_REPO:latest" ${{ steps.vars.outputs.version }}
|
||||
scripts/tag_multiarch_plugin.py -p $PLATFORMS "$DOCKER_REPO:latest" release
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: docker-net-dhcp ${{ steps.vars.outputs.version }}
|
||||
body_path: release.md
|
Loading…
Reference in New Issue