Files
lucide/.github/workflows/ci.yml
2021-04-19 22:48:14 +02:00

72 lines
2.1 KiB
YAML

name: Continuous integration icons
on:
push:
branches:
- master
paths:
- icons/**
jobs:
create-release:
if: github.repository == 'lucide-icons/lucide'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch tags
run: git fetch --tags
- name: Get latest tag
id: latest-tag
run: echo "::set-output name=LATEST_TAG::$(git tag --list 2>/dev/null | tail -n1 2>/dev/null)"
- name: Get yarn cache directory path
id: yarn_cache
run: echo "::set-output name=YARN_CACHE_DIR::$(yarn cache dir)"
- name: Get cached packaged
uses: actions/cache@v2
with:
path: ${{ steps.yarn_cache.outputs.YARN_CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --pure-lockfile
- name: Create new version
id: new-version
run: echo "::set-output name=NEW_VERSION::$(.github/workflows/version-up.sh --patch)"
- name: Create change log
id: change-log
run: |
CHANGE_LOG=$(yarn --silent run generate:changelog --old-tag=${{ steps.latest-tag.outputs.LATEST_TAG }})
CHANGE_LOG="${CHANGE_LOG//'%'/'%25'}"
CHANGE_LOG="${CHANGE_LOG//$'\n'/'%0A'}"
CHANGE_LOG="${CHANGE_LOG//$'\r'/'%0D'}"
echo $CHANGE_LOG
echo "::set-output name=CHANGE_LOG::$CHANGE_LOG"
env:
GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
- name: Check output
run: |
echo "${{ steps.new-version.outputs.NEW_VERSION }}"
echo "${{ steps.change-log.outputs.CHANGE_LOG }}"
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.CREATE_RELEASE_TOKEN }}
with:
tag_name: ${{ steps.new-version.outputs.NEW_VERSION }}
name: New icons ${{ steps.new-version.outputs.NEW_VERSION }}
body: ${{ steps.change-log.outputs.CHANGE_LOG }}