ci: add release #1
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: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
if: github.event.base_ref == 'refs/heads/master' | |
name: Publish release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build zip files | |
run: | | |
sudo apt-get update | |
sudo apt-get install libxml2-utils | |
make build release=1 | |
- name: Get zip filename | |
id: get-zip-filename | |
run: | | |
echo ::set-output name=zip-filename::$(cd ..;ls plugin.video.midarr*.zip | head -1) | |
- name: Get body | |
id: get-body | |
run: | | |
description=$(sed '/v[0-9\.]*\s([0-9-]*)/d;/^$/,$d' changelog.txt) | |
echo $description | |
description="${description//'%'/'%25'}" | |
description="${description//$'\n'/'%0A'}" | |
description="${description//$'\r'/'%0D'}" | |
echo ::set-output name=body::$description | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: ${{ steps.get-body.outputs.body }} | |
draft: false | |
prerelease: false | |
- name: Upload zip file | |
id: upload-zip | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_name: ${{ steps.get-zip-filename.outputs.zip-filename }} | |
asset_path: ../${{ steps.get-zip-filename.outputs.zip-filename }} | |
asset_content_type: application/zip |