diff --git a/.circleci/config.yml b/.circleci/config.yml index 92b780c..c21ca59 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,50 +2,13 @@ version: 2.1 description: Creates and updates the CHANGELOG.md file orbs: - changelog: - executors: - changelog: - docker: - - - image: circleci/ruby:2.5-node - jobs: - changelog: - parameters: - gitemail: - description: The git committer's email - type: string - default: aeneas@ory.sh - gitusername: - description: The git committer's username - type: string - default: aeneasr - gitauthtoken: - description: The git committer's username - type: string - executor: changelog - steps: - - run: git config --global push.default matching - - checkout - - run: gem install github_changelog_generator -v 1.14.3 - - run: sudo npm i -g doctoc - - restore_cache: - keys: - - changelog-v1 - - run: github_changelog_generator -u $CIRCLE_PROJECT_USERNAME -p $CIRCLE_PROJECT_REPONAME -o CHANGELOG.md --token <> --cache-file /tmp/github_changelog_generator - - save_cache: - key: changelog-v1 - paths: - - "/tmp/github_changelog_generator" - - run: doctoc CHANGELOG.md - - run: git config --global user.email "<>" - - run: git config --global user.name "<>" - - run: git add CHANGELOG.md - - run: | - git commit -m "Update CHANGELOG [ci skip]" -- CHANGELOG.md - - run: git push origin + orb-tools: circleci/orb-tools@2.0.0 workflows: - changelog: + btd: jobs: - - changelog/changelog: - gitauthtoken: $GITHUB_TOKEN + - orb-tools/publish: + orb-path: src/changelog.yml + orb-ref: ory/changelog@dev:${CIRCLE_BRANCH} + publish-token-variable: "$CIRCLECI_DEV_API_TOKEN" + validate: true diff --git a/CHANGELOG.md b/CHANGELOG.md index c2e10fc..e387458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* +**Table of Contents** - [Change Log](#change-log) @@ -8,6 +8,5 @@ # Change Log +This Change Log was automatically generated - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/changelog.yml b/changelog.yml deleted file mode 100644 index 7a3d834..0000000 --- a/changelog.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2.1 -description: Run a the changelog configurator - -orbs: - changelog: - executors: - changelog: - docker: - - image: circleci/ruby:2.5-node - jobs: - changelog: - parameters: - repo: - description: The GitHub repository - type: string - org: - description: The GitHub username - type: string - gitemail: - description: The git committer's email - type: string - default: office+ci@ory.sh - gituersname: - description: The git committer's username - type: string - default: ORY Continuous Integration - executor: changelog - steps: - - checkout - - run: gem install github_changelog_generator -v 1.14.3 - - run: sudo npm i -g doctoc - - restore_cache: - keys: - - changelog-v1 - - run: github_changelog_generator -u <> -p <> -o CHANGELOG.md --token $GITHUB_TOKEN --cache-file /tmp/github_changelog_generator - - save_cache: - key: changelog-v1 - paths: - - "/tmp/github_changelog_generator" - - run: doctoc CHANGELOG.md - - run: git config --global user.email "office+ci@ory.sh" - - run: git config --global user.name "ORY Continuous Integration" - - run: git add CHANGELOG.md - - run: git pull -ff - - run: | - git commit -m "docs: Incorporates changes from version $(git describe --tags) [ci skip]" -- CHANGELOG.md - - run: git remote rm origin - - run: git remote add origin https://arekkas:$GITHUB_TOKEN@github.com/<>/<>.git - - run: git push origin HEAD:master - - - -workflows: - main: - jobs: - - my-orb/myjob diff --git a/src/changelog.yml b/src/changelog.yml new file mode 100644 index 0000000..83e6928 --- /dev/null +++ b/src/changelog.yml @@ -0,0 +1,60 @@ +version: 2.1 +description: Creates and updates the CHANGELOG.md file + +orbs: + changelog: + executors: + changelog: + docker: + - + image: circleci/ruby:2.5-node + jobs: + generate: + parameters: + gitemail: + description: The git committer's email + type: string + default: aeneas@ory.sh + gitusername: + description: The git committer's username + type: string + default: aeneasr + gitauthtoken: + description: A GitHub API Token + type: env_var_name + default: GITHUB_TOKEN + executor: changelog + steps: + - run: git config --global push.default matching + - checkout + - run: gem install github_changelog_generator -v 1.14.3 + - run: sudo npm i -g doctoc + - restore_cache: + keys: + - changelog-v1 + - run: github_changelog_generator -u $CIRCLE_PROJECT_USERNAME -p $CIRCLE_PROJECT_REPONAME -o CHANGELOG.md --token ${<>} --cache-file /tmp/github_changelog_generator + - save_cache: + key: changelog-v1 + paths: + - "/tmp/github_changelog_generator" + - run: doctoc CHANGELOG.md + - run: "sed -i 's/\\*\\*Table of Contents.*/**Table of Contents**/' CHANGELOG.md" + - run: "sed -i 's/\\*This Change Log was.*/This Change Log was automatically generated/' CHANGELOG.md" + - run: git config --global user.email "<>" + - run: git config --global user.name "<>" + - run: git add CHANGELOG.md + - run: | + git commit -m "Update CHANGELOG [ci skip]" -- CHANGELOG.md || true + - run: git push origin || true + +examples: + changelog: + description: Generate and commit the changelog + usage: + version: 2.1 + orbs: + foo: ory/changelog@0.0.0 + workflows: + generate: + jobs: + - changelog/changelog