Skip to content

Try creating file before copying #22

Try creating file before copying

Try creating file before copying #22

Workflow file for this run

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
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Echo variables # to test variable passing to windows runner
run: |
echo "LATEST_TAG_NAME=${{ needs.version.outputs.LATEST_TAG_NAME }}"
echo "LATEST_RELEASE_NAME=${{ needs.version.outputs.LATEST_RELEASE_NAME }}"
echo "PREVIOUS_VERSION=${{ needs.version.outputs.PREVIOUS_VERSION }}"
dir
- name: Download latest Simple Icons release
run: |
Invoke-WebRequest -Uri "https://github.com/simple-icons/simple-icons/archive/refs/heads/master.zip" -OutFile "simple-icons.zip"
shell: pwsh
- name: Extract Simple Icons
run: 7z x simple-icons.zip -o./simple-icons
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: python script/main.py ./simple-icons/simple-icons-master ${{ needs.version.outputs.LATEST_TAG_NAME }}
shell: pwsh
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: Show changed files for testing
run: |
cat template/manifest.json
cat README.md
# TODO: Add a step to commit the changes to manifest.json and README.md
# Create a new release with the new version number