v1.0.4 #5
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: 'Create download links' | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get latest release | |
id: get-latest-release | |
uses: InsonusK/[email protected] | |
with: | |
myToken: ${{ github.token }} | |
view_top: 1 | |
- name: Substr the version | |
uses: bhowell2/[email protected] | |
id: value | |
with: | |
value: ${{ steps.get-latest-release.outputs.tag_name }} | |
index_of_str: 'v' | |
- name: Create Silicon download link | |
env: | |
GITHUB_USER: 'aolsenjazz' | |
REPO: 'mimic' | |
FORMAT: 'dmg' | |
VERSION: '${{ steps.get-latest-release.outputs.tag_name }}' | |
VERSION_NUM: '${{ steps.value.outputs.substring }}' | |
BEGIN_TAG: '<!-- DOWNLOAD SILICON -->' | |
END_TAG: '<!-- END DOWNLOAD SILICON -->' | |
run: | | |
UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\n<a href="https://github.com/${{ env.GITHUB_USER }}/${{ env.REPO }}/releases/download/${{ env.VERSION }}/Mimic-${{ env.VERSION_NUM }}.${{ env.FORMAT }}">Download (Apple Intel)</a>\n${2}#g') | |
echo "${UPDATE}" > README.md | |
- name: Create Intel download link | |
env: | |
GITHUB_USER: 'aolsenjazz' | |
REPO: 'mimic' | |
FORMAT: 'dmg' | |
VERSION: '${{ steps.get-latest-release.outputs.tag_name }}' | |
VERSION_NUM: '${{ steps.value.outputs.substring }}' | |
BEGIN_TAG: '<!-- DOWNLOAD INTEL -->' | |
END_TAG: '<!-- END DOWNLOAD INTEL -->' | |
run: | | |
UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\n<a href="https://github.com/${{ env.GITHUB_USER }}/${{ env.REPO }}/releases/download/${{ env.VERSION }}/Mimic-${{ env.VERSION_NUM }}-arm64.${{ env.FORMAT }}">Download (Apple Silicon)</a>\n${2}#g') | |
echo "${UPDATE}" > README.md | |
- uses: EndBug/add-and-commit@v7 | |
with: | |
message: 'docs(readme): Bump download button version to ${{ steps.get-latest-release.outputs.tag_name }}' | |
default_author: github_actions | |
branch: main |