From 431a7b834abd296f58bf6c5019a41d1d445abbe8 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 21 Feb 2021 13:48:23 +0100 Subject: [PATCH 1/8] init changelog script --- package.json | 1 + scripts/generateChangelog.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 scripts/generateChangelog.js diff --git a/package.json b/package.json index 9b22904bf..b659b97a2 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "build:bundles": "rollup -c rollup.config.js", "optimize": "npx babel-node ./scripts/optimizeSvgs.js --presets @babel/env", "addtags": "npx babel-node ./scripts/addMissingKeysToTags.js --presets @babel/env", + "generate:changelog": "npx babel-node ./scripts/generateChangelog.js --presets @babel/env", "test": "jest" }, "devDependencies": { diff --git a/scripts/generateChangelog.js b/scripts/generateChangelog.js new file mode 100644 index 000000000..1f6220ec4 --- /dev/null +++ b/scripts/generateChangelog.js @@ -0,0 +1,29 @@ +// 'https://api.github.com/repos/lucide-icons/lucide/compare/v0.13.0...master' +import output from './tempOutput.json'; + +const iconFolderRegex = /icons\/(.*)\.svg/g; + +const changedFiles = output.files.filter( + ({ filename }) => !filename.match(/site\/(.*)|(.*)package\.json/g), +); + +const addedIcons = changedFiles.filter( + ({ status, filename }) => status === 'added' && filename.match(iconFolderRegex), +); + +const modifiedIcons = changedFiles.filter( + ({ status, filename }) => status === 'modified' && filename.match(iconFolderRegex), +); + +// const addedIconsWithcommits +// console.log(modifiedIcons); + +const topics = { + newIcons: 'New Icons', + modifiedIcons: 'Modified Icons', + codeChanges: 'Code improvements', + docs: 'Docs', + lucide: 'Lucide Package', + lucideReact: 'Lucide React Package', + lucideVue: 'Lucide Vue Package', +}; From 7f1dc27ee3f4c8abb33812a3260beeb6be9fecb5 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 21 Feb 2021 18:57:11 +0100 Subject: [PATCH 2/8] Add Changelog generator --- package.json | 1 + scripts/generateChangelog.js | 93 +++++++++++++++++++++++++++--------- scripts/githubApi.js | 22 +++++++++ yarn.lock | 5 ++ 4 files changed, 98 insertions(+), 23 deletions(-) create mode 100644 scripts/githubApi.js diff --git a/package.json b/package.json index 8181cb068..b1c541dd4 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "jest": "^26.4.2", "lint-staged": "^10.5.3", "minimist": "^1.2.5", + "node-fetch": "^2.6.1", "prettier": "1.17.1", "rollup": "^2.7.3", "rollup-plugin-commonjs": "^10.1.0", diff --git a/scripts/generateChangelog.js b/scripts/generateChangelog.js index 1f6220ec4..97dbc1f94 100644 --- a/scripts/generateChangelog.js +++ b/scripts/generateChangelog.js @@ -1,29 +1,76 @@ -// 'https://api.github.com/repos/lucide-icons/lucide/compare/v0.13.0...master' -import output from './tempOutput.json'; +import githubApi from './githubApi'; -const iconFolderRegex = /icons\/(.*)\.svg/g; +const fetchCompareTags = oldTag => + githubApi(`https://api.github.com/repos/lucide-icons/lucide/compare/${oldTag}...master`); -const changedFiles = output.files.filter( - ({ filename }) => !filename.match(/site\/(.*)|(.*)package\.json/g), -); +const iconRegex = /icons\/(.*)\.svg/g; +const iconTemplate = ({ name, pullNumber, author }) => + `- \`${name}\` (${pullNumber}) by @${author}`; -const addedIcons = changedFiles.filter( - ({ status, filename }) => status === 'added' && filename.match(iconFolderRegex), -); +const topics = [ + { + title: 'New icons 🎨', + template: iconTemplate, + filter: ({ status, filename }) => status === 'added' && filename.match(iconRegex), + }, + { + title: 'Modified Icons 🔨', + template: iconTemplate, + filter: ({ status, filename }) => status === 'modified' && filename.match(iconRegex), + }, + { + title: 'Code improvements ⚡', + template: ({ title, pullNumber, author }) => `- ${title} (${pullNumber}) by @${author}`, + filter: ({ filename }, index, self) => + !filename.match(iconRegex) && self.indexOf(filename) === index, + }, +]; -const modifiedIcons = changedFiles.filter( - ({ status, filename }) => status === 'modified' && filename.match(iconFolderRegex), -); +const fetchCommits = async file => { + const commits = await githubApi( + `https://api.github.com/repos/lucide-icons/lucide/commits?path=${file.filename}`, + ); -// const addedIconsWithcommits -// console.log(modifiedIcons); - -const topics = { - newIcons: 'New Icons', - modifiedIcons: 'Modified Icons', - codeChanges: 'Code improvements', - docs: 'Docs', - lucide: 'Lucide Package', - lucideReact: 'Lucide React Package', - lucideVue: 'Lucide Vue Package', + return { ...file, commits }; }; + +// eslint-disable-next-line func-names +(async function() { + const output = await fetchCompareTags('v0.13.0'); + const changedFiles = output.files.filter( + ({ filename }) => !filename.match(/site\/(.*)|(.*)package\.json|tags.json/g), + ); + + const commits = await Promise.all(changedFiles.map(fetchCommits)); + + const mappedCommits = commits + .map(({ commits: [pr], filename, sha, status }) => { + const pullNumber = /(.*)\((#[0-9]*)\)/gm.exec(pr.commit.message); + const nameRegex = /^\/?(.+\/)*(.+)\.(.+)$/g.exec(filename); + + return { + filename, + name: nameRegex && nameRegex[2] ? nameRegex[2] : null, + title: pullNumber && pullNumber[1] ? pullNumber[1].trim() : null, + pullNumber: pullNumber && pullNumber[2] ? pullNumber[2].trim() : null, + author: pr.author.login, + sha, + status, + }; + }) + .filter(({ pullNumber }) => !!pullNumber); + + const changelog = topics.map(({ title, filter, template }) => { + const lines = mappedCommits.filter(filter).map(template); + + if (lines.length) { + return [`## ${title}`, ' ', ...lines, ' ']; + } + + return ['']; + }); + + const changelogMarkown = changelog.flat().join('\n'); + + console.log(changelogMarkown); +})(); diff --git a/scripts/githubApi.js b/scripts/githubApi.js new file mode 100644 index 000000000..de5c5584a --- /dev/null +++ b/scripts/githubApi.js @@ -0,0 +1,22 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import fetch, { Headers } from 'node-fetch'; + +const githubApi = async endpoint => { + const headers = new Headers(); + const username = 'ericfennis'; + const password = process.env.GITHUB_API_KEY; + + headers.set( + 'Authorization', + `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`, + ); + + const res = await fetch(endpoint, { + method: 'GET', + headers, + }); + + return res.json(); +}; + +export default githubApi; diff --git a/yarn.lock b/yarn.lock index bdb417a07..08314048a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4636,6 +4636,11 @@ node-environment-flags@^1.0.5: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" +node-fetch@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" From b46b157dbcea8233ef16c6767941c1b513e9f848 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Fri, 2 Apr 2021 22:06:40 +0200 Subject: [PATCH 3/8] Add code-2 icon --- icons/code-2.svg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 icons/code-2.svg diff --git a/icons/code-2.svg b/icons/code-2.svg new file mode 100644 index 000000000..04bb18381 --- /dev/null +++ b/icons/code-2.svg @@ -0,0 +1,15 @@ + + + + + From 343ebd3d7b4995da382730d35259bc78beaa1105 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sat, 3 Apr 2021 18:45:12 +0200 Subject: [PATCH 4/8] test --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..24ddc5181 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +name: yarn version + +on: ['push'] + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - name: Yarn + run: yarn -v From b5201d2b38e6a9e36e979f4f33260679f756d95c Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 4 Apr 2021 14:45:49 +0200 Subject: [PATCH 5/8] improve workflows --- .github/workflows/ci.yml | 37 ++++ .github/workflows/font.yml | 1 + .github/workflows/release.yml | 36 ++-- .github/workflows/test.yml | 11 -- .github/workflows/version-up.sh | 292 ++++++++++++++++++++++++++++++++ yarn.lock | 2 +- 6 files changed, 357 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml create mode 100755 .github/workflows/version-up.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..6042f97f3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +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: Create change log + id: change-log + run: echo "::set-output name=CHANGE_LOG::$(yarn generate:changelog)" + + - name: Create new version + id: new-version + run: echo ""::set-output name=NEW_VERSION::$(.github/workflows/version-up.sh --patch)" + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: ${{ github.ref }} + diff --git a/.github/workflows/font.yml b/.github/workflows/font.yml index 4cf830558..5520deefe 100644 --- a/.github/workflows/font.yml +++ b/.github/workflows/font.yml @@ -2,6 +2,7 @@ name: Build Lucide on: push: branches: [ master ] + pull_request: branches: [ master ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47fd5770b..87cc89627 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,13 +59,10 @@ jobs: - name: Publish run: yarn workspace lucide publish - - name: Commit package.json - run: | - git add packages/lucide/package.json - git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ - commit -m ":package: Bump version lucide to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet - git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git - git push origin HEAD:master + - name: Upload package.json + uses: actions/upload-artifact@v2 + with: + path: packages/lucide/package.json lucide-react: if: github.repository == 'lucide-icons/lucide' @@ -104,6 +101,11 @@ jobs: - name: Publish run: yarn workspace lucide-react publish + - name: Upload package.json + uses: actions/upload-artifact@v2 + with: + path: packages/lucide-react/package.json + - name: Commit package.json run: | git add packages/lucide-react/package.json @@ -149,10 +151,24 @@ jobs: - name: Publish run: yarn workspace lucide-vue publish - - name: Commit package.json + - name: Upload package.json + uses: actions/upload-artifact@v2 + with: + path: packages/lucide-vue/package.json + + upload-package-jsons: + if: github.repository == 'lucide-icons/lucide' + runs-on: ubuntu-latest + needs: [lucide, lucide-react, lucide-vue] + + steps: + - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + + - name: Commit package.jsons run: | - git add packages/lucide-vue/package.json + git add packages/*/package.json git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ - commit -m ":package: Bump version lucide-vue to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet + commit -m ":package: Bump version lucide to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git git push origin HEAD:master diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 24ddc5181..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: yarn version - -on: ['push'] - -jobs: - run: - runs-on: ubuntu-latest - - steps: - - name: Yarn - run: yarn -v diff --git a/.github/workflows/version-up.sh b/.github/workflows/version-up.sh new file mode 100755 index 000000000..1a9631b7a --- /dev/null +++ b/.github/workflows/version-up.sh @@ -0,0 +1,292 @@ +#!/usr/bin/env bash +## Copyright (C) 2017, Oleksandr Kucherenko +## Last revisit: 2017-09-29 + +## get highest version tag for all branches +function highest_tag(){ + local TAG=$(git tag --list 2>/dev/null | tail -n1 2>/dev/null) + echo "$TAG" +} + +## extract current branch name +function current_branch(){ + ## expected: heads/{branch_name} + ## expected: {branch_name} + local BRANCH=$(git rev-parse --abbrev-ref HEAD | cut -d"/" -f2) + echo "$BRANCH" +} + +## get latest/head commit hash number +function head_hash(){ + local COMMIT_HASH=$(git rev-parse --verify HEAD) + echo "$COMMIT_HASH" +} + +## extract tag commit hash code, tag name provided by argument +function tag_hash(){ + local TAG_HASH=$(git log -1 --format=format:"%H" $1 2>/dev/null | tail -n1) + echo "$TAG_HASH" +} + +## get latest tag in specified branch +function latest_tag(){ + #local TAG=$(git describe --tags $(git rev-list --tags --max-count=1 2>/dev/null) 2>/dev/null) + local TAG=$(git describe --tags --abbrev=0 2>/dev/null) + echo "$TAG" +} + +## get latest revision number +function latest_revision(){ + local REV=$(git rev-list --count HEAD 2>/dev/null) + echo "$REV" +} + +## parse last found tag, extract it PARTS +function parse_last(){ + local position=$(($1-1)) + + # two parts found only + local SUBS=( ${PARTS[$position]//-/ } ) + #echo ${SUBS[@]}, size: ${#SUBS} + + # found NUMBER + PARTS[$position]=${SUBS[0]} + #echo ${PARTS[@]} + + # found SUFFIX + if [[ ${#SUBS} -ge 1 ]]; then + PARTS[4]=${SUBS[1],,} #lowercase + #echo ${PARTS[@]}, ${SUBS[@]} + fi +} + +## increment REVISION part, don't touch STAGE +function increment_revision(){ + PARTS[3]=$(( PARTS[3] + 1 )) + IS_DIRTY=1 +} + +## increment PATCH part, reset all other lower PARTS, don't touch STAGE +function increment_patch(){ + PARTS[2]=$(( PARTS[2] + 1 )) + PARTS[3]=0 + IS_DIRTY=1 +} + +## increment MINOR part, reset all other lower PARTS, don't touch STAGE +function increment_minor(){ + PARTS[1]=$(( PARTS[1] + 1 )) + PARTS[2]=0 + PARTS[3]=0 + IS_DIRTY=1 +} + +## increment MAJOR part, reset all other lower PARTS, don't touch STAGE +function incremet_major(){ + PARTS[0]="v$(( PARTS[0] + 1 ))" + PARTS[1]=0 + PARTS[2]=0 + PARTS[3]=0 + IS_DIRTY=1 +} + +## increment the number only of last found PART: REVISION --> PATCH --> MINOR. don't touch STAGE +function increment_last_found(){ + if [[ "${#PARTS[3]}" == 0 || "${PARTS[3]}" == "0" ]]; then + if [[ "${#PARTS[2]}" == 0 || "${PARTS[2]}" == "0" ]]; then + increment_minor + else + increment_patch + fi + else + increment_revision + fi + + # stage part is not EMPTY + if [[ "${#PARTS[4]}" != 0 ]]; then + IS_SHIFT=1 + fi +} + +## compose version from PARTS +function compose(){ + MAJOR="${PARTS[0]}" + MINOR=".${PARTS[1]}" + PATCH=".${PARTS[2]}" + REVISION=".${PARTS[3]}" + SUFFIX="-${PARTS[4]}" + + if [[ "${#PATCH}" == 1 ]]; then # if empty {PATCH} + PATCH="" + fi + + if [[ "${#REVISION}" == 1 ]]; then # if empty {REVISION} + REVISION="" + fi + + if [[ "${PARTS[3]}" == "0" ]]; then # if revision is ZERO + REVISION="" + fi + + # shrink patch and revision + if [[ -z "${REVISION// }" ]]; then + if [[ "${PARTS[2]}" == "0" ]]; then + PATCH=".0" + fi + else # revision is not EMPTY + if [[ "${#PATCH}" == 0 ]]; then + PATCH=".0" + fi + fi + + # remove suffix if we don't have a alpha/beta/rc + if [[ "${#SUFFIX}" == 1 ]]; then + SUFFIX="" + fi + + + echo "${MAJOR}${MINOR}${PATCH}${REVISION}${SUFFIX}" #full format +} + +# initial version used for repository without tags +INIT_VERSION=0.0.0.0-alpha + +# do GIT data extracting +TAG=$(latest_tag) +REVISION=$(latest_revision) +BRANCH=$(current_branch) +TOP_TAG=$(highest_tag) +TAG_HASH=$(tag_hash $TAG) +HEAD_HASH=$(head_hash) + +# if tag and branch commit hashes are different, than print info about that +#echo $HEAD_HASH vs $TAG_HASH +if [[ "$@" == "" ]]; then + if [[ "$TAG_HASH" == "$HEAD_HASH" ]]; then + echo "Tag $TAG and HEAD are aligned. We will stay on the TAG version." + echo "" + NO_ARGS_VALUE='--stay' + else + PATTERN="^[0-9]+.[0-9]+(.[0-9]+)*(-(alpha|beta|rc))*$" + + if [[ "$BRANCH" =~ $PATTERN ]]; then + echo "Detected version branch '$BRANCH'. We will auto-increment the last version PART." + echo "" + NO_ARGS_VALUE='--default' + else + echo "Detected branch name '$BRANCH' than does not match version pattern. We will increase MINOR." + echo "" + NO_ARGS_VALUE='--minor' + fi + fi +fi + +# +# {MAJOR}.{MINOR}[.{PATCH}[.{REVISION}][-(.*)] +# +# Suffix: alpha, beta, rc +# No Suffix --> {NEW_VERSION}-alpha +# alpha --> beta +# beta --> rc +# rc --> {VERSION} +# +PARTS=( ${TAG//./ } ) +parse_last ${#PARTS[@]} # array size as argument +#echo ${PARTS[@]} + +# if no parameters than emulate --default parameter +if [[ "$@" == "" ]]; then + set -- $NO_ARGS_VALUE +fi + +# parse input parameters +for i in "$@" +do + key="$i" + + case $key in + -a|--alpha) # switched to ALPHA + PARTS[4]="alpha" + IS_SHIFT=1 + ;; + -b|--beta) # switched to BETA + PARTS[4]="beta" + IS_SHIFT=1 + ;; + -c|--release-candidate) # switched to RC + PARTS[4]="rc" + IS_SHIFT=1 + ;; + -r|--release) # switched to RELEASE + PARTS[4]="" + IS_SHIFT=1 + ;; + -p|--patch) # increment of PATCH + increment_patch + ;; + -e|--revision) # increment of REVISION + increment_revision + ;; + -g|--git-revision) # use git revision number as a revision part§ + PARTS[3]=$(( REVISION )) + IS_DIRTY=1 + ;; + -i|--minor) # increment of MINOR by default + increment_minor + ;; + --default) # stay on the same stage, but increment only last found PART of version code + increment_last_found + ;; + -m|--major) # increment of MAJOR + incremet_major + ;; + -s|--stay) # extract version info + IS_DIRTY=1 + NO_APPLY_MSG=1 + ;; + -t|--tag-only) # extract version info + TAG_ONLY=1 + ;; + --apply) + DO_APPLY=1 + ;; + -h|--help) + help + ;; + esac + shift +done + +# detected shift, but no increment +if [[ "$IS_SHIFT" == "1" ]]; then + # temporary disable stage shift + stage=${PARTS[4]} + PARTS[4]='' + + # detect first run on repository, INIT_VERSION was used + if [[ "$(compose)" == "0.0" ]]; then + increment_minor + fi + + PARTS[4]=$stage +fi + +# no increment applied yet and no shift of state, do minor increase +if [[ "$IS_DIRTY$IS_SHIFT" == "" ]]; then + increment_minor +fi + +compose + +# is proposed tag in conflict with any other TAG +PROPOSED_HASH=$(tag_hash $(compose)) +if [[ "${#PROPOSED_HASH}" -gt 0 && "$NO_APPLY_MSG" == "" ]]; then + echo -e "\033[31mERROR:\033[0m " + echo -e "\033[31mERROR:\033[0m Found conflict with existing tag \033[32m$(compose)\033[0m / $PROPOSED_HASH" + echo -e "\033[31mERROR:\033[0m Only manual resolving is possible now." + echo -e "\033[31mERROR:\033[0m " + echo -e "\033[31mERROR:\033[0m To Resolve try to add --revision or --patch modifier." + echo -e "\033[31mERROR:\033[0m " + echo "" + exit 1 +fi diff --git a/yarn.lock b/yarn.lock index a3050db54..893457ebb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7548,7 +7548,7 @@ node-environment-flags@^1.0.5: object.getownpropertydescriptors "^2.0.3" semver "^5.7.0" -node-fetch@2.6.1: +node-fetch@2.6.1, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== From 38fb2ca283acc4abdb9262f97bb017b5c93beba6 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 4 Apr 2021 14:47:01 +0200 Subject: [PATCH 6/8] fix indentation --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87cc89627..b7e0ac78c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -166,9 +166,9 @@ jobs: - uses: actions/download-artifact@v2 - name: Commit package.jsons - run: | - git add packages/*/package.json - git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ - commit -m ":package: Bump version lucide to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet - git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git - git push origin HEAD:master + run: | + git add packages/*/package.json + git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ + commit -m ":package: Bump version lucide to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet + git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git + git push origin HEAD:master From c3e7e0c834362bf16693410c24adbb391a86c0b4 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Sun, 4 Apr 2021 23:46:18 +0200 Subject: [PATCH 7/8] format file --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6042f97f3..ff49a9515 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,21 +17,21 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - 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: echo "::set-output name=CHANGE_LOG::$(yarn generate:changelog)" - - name: Create new version - id: new-version - run: echo ""::set-output name=NEW_VERSION::$(.github/workflows/version-up.sh --patch)" - - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: - tag_name: ${{ github.ref }} + tag_name: ${{ steps.new-version.outputs.NEW_VERSION }} release_name: Release ${{ github.ref }} - body: ${{ github.ref }} + body: ${{ steps.change-log.outputs.CHANGE_LOG }} From a5d1f2964b7f68bbc1763f0a65f3da33b16d280f Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Mon, 5 Apr 2021 17:17:29 +0200 Subject: [PATCH 8/8] small fixes workflow --- .github/workflows/release.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7e0ac78c..1a1eb34b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,6 @@ jobs: needs: pre-build steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '12.x' - - uses: actions/cache@v2 id: yarn-cache with: @@ -70,10 +66,6 @@ jobs: needs: pre-build steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '12.x' - - uses: actions/cache@v2 id: yarn-cache with: @@ -106,14 +98,6 @@ jobs: with: path: packages/lucide-react/package.json - - name: Commit package.json - run: | - git add packages/lucide-react/package.json - git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ - commit -m ":package: Bump version lucide-react to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet - git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git - git push origin HEAD:master - lucide-vue: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest @@ -164,11 +148,10 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 - - name: Commit package.jsons run: | git add packages/*/package.json git -c user.name="Lucide Bot" -c user.email="lucide-bot@users.noreply.github.com" \ - commit -m ":package: Bump version lucide to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet + commit -m ":package: Bump lucide package versions to ${{ needs.pre-build.outputs.VERSION }}" --no-verify --quiet git remote set-url --push origin https://lucide-bot:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git git push origin HEAD:master