Force run by changing version #44
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 Release | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 1' | |
jobs: | |
version: | |
name: Get versions and meta | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
outputs: | |
LATEST_TAG_NAME: ${{ steps.getSimpleIconsVersion.outputs.latest_tag_name }} | |
LATEST_RELEASE_NAME: ${{ steps.getSimpleIconsVersion.outputs.latest_release_name }} | |
PREVIOUS_VERSION: ${{ steps.getSimpleIconsVersion.outputs.previous_version }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Get Simple Icons version and release name plus previous version of icon pack | |
id: getSimpleIconsVersion | |
run: | | |
simple_icons_release_data="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/releases/latest)" | |
echo "latest_tag_name=$(echo "$simple_icons_release_data" | jq -r '.tag_name')" >> $GITHUB_OUTPUT | |
echo "latest_release_name=$(echo "$simple_icons_release_data" | jq -r '.name')" >> $GITHUB_OUTPUT | |
echo "previous_version=$(jq -r '.Version' template/manifest.json)" >> $GITHUB_OUTPUT | |
build: | |
name: Build Icon Pack | |
timeout-minutes: 10 | |
needs: version | |
if: ${{ needs.version.outputs.LATEST_TAG_NAME != needs.version.outputs.PREVIOUS_VERSION }} | |
runs-on: windows-latest | |
permissions: write-all | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Download latest Simple Icons release | |
run: | | |
Invoke-WebRequest -Uri "https://github.com/simple-icons/simple-icons/archive/refs/tags/${{ needs.version.outputs.LATEST_TAG_NAME }}.zip" -OutFile "simple-icons-${{ needs.version.outputs.LATEST_TAG_NAME }}.zip" | |
shell: pwsh | |
- name: Extract Simple Icons | |
run: 7z x simple-icons-${{ needs.version.outputs.LATEST_TAG_NAME }}.zip -o./simple-icons-${{ needs.version.outputs.LATEST_TAG_NAME }} | |
shell: cmd | |
- name: Install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run script/main.py with the latest Simple Icons release | |
run: | | |
cd script | |
python main.py ./../simple-icons-${{ needs.version.outputs.LATEST_TAG_NAME }}/simple-icons-${{ needs.version.outputs.LATEST_TAG_NAME }} ${{ needs.version.outputs.LATEST_TAG_NAME }} | |
cd .. | |
shell: pwsh | |
- name: Upload Icon Pack | |
uses: actions/upload-artifact@v3 | |
with: | |
name: com.mackenly.simpleiconsstreamdeck.streamDeckIconPack | |
path: ./out/com.mackenly.simpleiconsstreamdeck.streamDeckIconPack | |
if-no-files-found: error | |
retention-days: 2 | |
release: | |
name: Create new Release | |
timeout-minutes: 5 | |
needs: [version, build] | |
if: ${{ needs.version.outputs.LATEST_TAG_NAME != needs.version.outputs.PREVIOUS_VERSION }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Update manifest.json template version and README.md | |
run: | | |
sed -i "s/\"Version\": \".*\"/\"Version\": \"${{ needs.version.outputs.LATEST_TAG_NAME }}\"/g" template/manifest.json | |
sed -i 's/${{ needs.version.outputs.PREVIOUS_VERSION }}/${{ needs.version.outputs.LATEST_TAG_NAME }}/g' README.md | |
- name: Commit and push changes to manifest.json and README.md | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add template/manifest.json | |
git add README.md | |
git commit -m "Update manifest.json and README.md to version ${{ needs.version.outputs.LATEST_TAG_NAME }}" | |
git push | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: com.mackenly.simpleiconsstreamdeck.streamDeckIconPack | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
body: | | |
# Simple Icons Stream Deck Icon Pack | |
Version ${{ needs.version.outputs.LATEST_TAG_NAME }} | |
${{ needs.version.outputs.LATEST_RELEASE_NAME }} | |
makeLatest: true | |
name: ${{ needs.version.outputs.LATEST_TAG_NAME }} | |
replacesArtifacts: true | |
removeArtifacts: true | |
tag: ${{ needs.version.outputs.LATEST_TAG_NAME }} | |
draft: true |