Skip to content

Create Release

Create Release #61

name: Create Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
milestone:
types: [closed]
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
# issues need to be closed to generate release notes
- name: Close issues
id: close_issues
uses: lee-dohm/close-matching-issues@v2
with:
query: "milestone:${{ github.event.milestone.title }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release Notes
uses: docker://decathlon/release-notes-generator-action:2.0.1
id: Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT_FOLDER: temp_release_notes
- name: Read temp_release_notes/release_file.md
id: read_release_file
uses: juliangruber/read-file-action@v1
with:
path: ./temp_release_notes/release_file.md
- name: Update version in plist
run: |
sed "/version/{n;s/<string>[0-9]*\.[0-9]*<\/string>/<string>${{ github.event.milestone.title }}<\/string>/g}" ./spotify-mini-player/info.plist > ./spotify-mini-player/info.plist.tmp
mv ./spotify-mini-player/info.plist.tmp ./spotify-mini-player/info.plist
- name: push
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: 'master'
commit-message: 'updating version'
files: ./spotify-mini-player/info.plist
name: Vincent de Saboulin
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v-${{ github.event.milestone.title }}
release_name: Version ${{ github.event.milestone.title }}
body: |
${{ steps.read_release_file.outputs.content }}
draft: false
prerelease: false
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
cd ./spotify-mini-player && zip -r ../spotifyminiplayer.alfredworkflow * -x \*.git\* -x \*.zip\* -x \*.idraw\* -x \temp_release_notes.*\* -x \composer.*\* -x vendor/jwilsson/spotify-web-api-php/tests/**\*
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./spotifyminiplayer.alfredworkflow
asset_name: spotifyminiplayer.alfredworkflow
asset_content_type: application/zip