Merge pull request #141 from einanderson/feature/supported-codecs #14
Workflow file for this run
This file contains hidden or 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
| # Based on https://github.com/im85288/service.upnext/blob/master/.github/workflows/release.yml | |
| name: Make Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| - '*-dev' | |
| jobs: | |
| release: | |
| if: github.repository == 'anxdpanic/script.module.python.twitch' | |
| name: Make Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Release Status | |
| id: release | |
| run: | | |
| version=${GITHUB_REF/refs\/tags\//} | |
| if [[ $version == *-dev ]] ; | |
| then | |
| echo ::set-output name=pre-release::true | |
| else | |
| echo ::set-output name=pre-release::false | |
| fi | |
| - name: Checkout Add-on | |
| uses: actions/checkout@v3 | |
| with: | |
| path: ${{ github.event.repository.name }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install libxml2-utils xmlstarlet zip | |
| - name: Get Changelog | |
| id: changelog | |
| run: | | |
| changes=$(xmlstarlet sel -t -v '//news' -n addon.xml) | |
| changes="${changes//'%'/'%25'}" | |
| changes="${changes//$'\n'/'%0A'}" | |
| changes="${changes//$'\r'/'%0D'}" | |
| echo ::set-output name=changes::$changes | |
| working-directory: ${{ github.event.repository.name }} | |
| - name: Remove Unwanted Files | |
| run: | | |
| mv .git .. | |
| rm -rf .??* | |
| rm *.md | |
| working-directory: ${{ github.event.repository.name }} | |
| - name: Create Zip (Nexus) | |
| id: zip-nexus | |
| run: | | |
| version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) | |
| filename=${{ github.event.repository.name }}-${version}.zip | |
| cd .. | |
| zip -r $filename ${{ github.event.repository.name }} | |
| echo ::set-output name=filename::$filename | |
| working-directory: ${{ github.event.repository.name }} | |
| - name: Create 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.changelog.outputs.changes }} | |
| draft: false | |
| prerelease: ${{ steps.release.outputs.pre-release }} | |
| - name: Upload Zip (Nexus) | |
| id: upload-nexus | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_name: ${{ steps.zip-nexus.outputs.filename }} | |
| asset_path: ${{ steps.zip-nexus.outputs.filename }} | |
| asset_content_type: application/zip |