Skip to content

Commit

Permalink
Merge pull request #1 from primer/release_changesets
Browse files Browse the repository at this point in the history
Create changeset workflow
  • Loading branch information
jonrohan authored Oct 22, 2021
2 parents 0d0adcc + 1c7ba01 commit 8719911
Show file tree
Hide file tree
Showing 9 changed files with 872 additions and 54 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
10 changes: 10 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.1/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "primer/octicons"}],
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/funny-kings-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/octicons-svg": patch
---

Create changeset workflow
54 changes: 19 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
on:
push:
branches:
- main
pull_request:
branches-ignore:
- 'dependabot/**'
release:
types: [published]
name: Octicons Build
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '10.x'
- name: Version
uses: ./.github/actions/version
node-version: '12'
- run: npm install
- run: npm run build
- run: cp -r icons lib/build/svg
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v2
with:
name: octicons
path: ./lib/build
gem:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@master
- name: Version
uses: ./.github/actions/version
- uses: actions/download-artifact@master
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: octicons
path: ./lib/build
Expand All @@ -40,22 +32,20 @@ jobs:
with:
args: octicons_gem
- run: ls ./lib/octicons_gem/pkg
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v2
with:
name: octicons_gem
path: ./lib/octicons_gem/pkg
helper:
runs-on: ubuntu-latest
needs: gem
steps:
- uses: actions/checkout@master
- name: Version
uses: ./.github/actions/version
- uses: actions/download-artifact@master
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: octicons
path: ./lib/build
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v2
with:
name: octicons_gem
path: ./lib/octicons_helper/vendor/cache
Expand All @@ -68,14 +58,12 @@ jobs:
runs-on: ubuntu-latest
needs: gem
steps:
- uses: actions/checkout@master
- name: Version
uses: ./.github/actions/version
- uses: actions/download-artifact@master
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: octicons
path: ./lib/build
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v2
with:
name: octicons_gem
path: ./lib/octicons_jekyll/vendor/cache
Expand All @@ -88,10 +76,8 @@ jobs:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@master
- name: Version
uses: ./.github/actions/version
- uses: actions/download-artifact@master
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: octicons
path: ./lib/build
Expand All @@ -104,10 +90,8 @@ jobs:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@master
- name: Version
uses: ./.github/actions/version
- uses: actions/download-artifact@master
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: octicons
path: ./lib/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: bundle exec rake test
- name: Build
run: bundle exec rake build
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v2
with:
name: octicons-gem
path: ./lib/octicons_gem/pkg
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/optimize.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
push:
paths:
- 'icons/**'
Expand All @@ -8,10 +8,10 @@ jobs:
optimize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '10.x'
node-version: '12'
- run: npm install
- run: npm run svgo
- uses: EndBug/add-and-commit@v4
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- 'main'
- 'next_major'
jobs:
release:
name: Final
if: ${{ github.repository == 'primer/octicons' }}

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x

- name: Install dependencies
run: yarn

- name: Create release pull request or publish to npm
id: changesets
uses: changesets/action@master
with:
title: Release Tracking
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"private": true,
"name": "@primer/octicons-svg",
"version": "16.0.0",
"scripts": {
"version": "script/version",
"test": "ava -v tests/*.js",
"lint": "eslint tests",
"build": "script/build.js --input icons/**/*.svg --output lib/build/data.json",
"start": "cd docs && npm run develop",
"svgo": "svgo icons --config .svgo.yml"
"svgo": "svgo icons --config .svgo.yml",
"release": "changeset publish"
},
"dependencies": {
"@changesets/changelog-github": "0.4.1",
"@changesets/cli": "2.17.0",
"@github/prettier-config": "0.0.4",
"ava": "2.1.0",
"braces": "2.3.1",
Expand Down
Loading

0 comments on commit 8719911

Please sign in to comment.