Unverified Commit cad47f96 authored by Shawn Allen's avatar Shawn Allen Committed by GitHub

Merge pull request #238 from primer/release-8.1.0

Release 8.1.0
parents cbf33c9e fd92766c
......@@ -9,5 +9,4 @@ package-lock.json
vendor
# Ignore build/export artifacts
build/
lib/octicons_gem/lib/data.json
lib/**/build/
......@@ -5,26 +5,31 @@ node_js:
script:
- npm test
before_script:
# XXX this is a fix for nokogiri building on Travis
- npm run bootstrap
after_success:
# Setup rubygems creds
- curl -u $RUBYGEMS_USER:$RUBYGEMS_PW https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
- curl -u "$RUBYGEMS_USER:$RUBYGEMS_PW" https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials
- chmod 0600 ~/.gem/credentials
# this will short-circuit the publish step if it fails to interpolate $NPM_API_KEY
- npm config set "//registry.npmjs.org/:_authToken=\${NPM_API_KEY}"
- script/after_success
deploy:
# publish "final" releases on master
- provider: script
script: script/release
# publish release candidates from any branch beginning with "release"
- on:
condition: $TRAVIS_BRANCH =~ ^release
all_branches: true
tags: false
provider: script
script:
- script/release-candidate
skip_cleanup: true
on:
# publish "final" releases on master
- on:
branch: master
tags: false
provider: script
script: script/release
skip_cleanup: true
notifications:
slack: 'github:4OisIoqZYyMlWcw3hFtZgbmh'
......@@ -21,7 +21,7 @@ The octicons node.js library is the main JavaScript library. With [a JavaScript
| Package | Version |
|---|---|
| **[octicons](/lib/octicons_node)** <br />Node.js package with Javascript API | [![npm version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons) |
| **[@github/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](https://img.shields.io/npm/v/%40github%2Focticons-react.svg)](https://www.npmjs.org/package/%40github%2Focticons-react) |
| **[@githubprimer/octicons-react](/lib/octicons_react)** <br />React octicons components | [![npm version](https://img.shields.io/npm/v/@githubprimer/octicons-react.svg)](https://www.npmjs.org/package/@githubprimer/octicons-react) |
### Ruby
......
......@@ -7,5 +7,5 @@
"lib/octicons_jekyll",
"lib/octicons_react"
],
"version": "8.0.0"
"version": "8.1.0"
}
module Octicons
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
{
"name": "octicons_gem",
"version": "8.0.0",
"version": "8.1.0",
"description": "Don't install",
"scripts": {
"postinstall": "bundle install --path vendor/bundle",
"prepare": "cp -R ../build ./lib/",
"prepare": "cp -R ../build ./lib",
"version": "../../script/rubyversion ./lib/octicons/version.rb",
"prepublishOnly": "../../script/notify pending && ../../script/gem_publish",
"publish": "../../script/notify success",
......
......@@ -8,6 +8,6 @@ gem "rails"
group :development, :test do
gem "minitest"
gem "rake"
gem "rubocop"
gem "rubocop-github"
gem "rubocop", "0.50"
gem "rubocop-github", "0.5.0"
end
module OcticonsHelper
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
......@@ -13,6 +13,6 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency "octicons", "8.0.0"
s.add_dependency "octicons", "8.1.0"
s.add_dependency "rails"
end
{
"name": "octicons_helper",
"version": "8.0.0",
"version": "8.1.0",
"description": "A rails helper that makes including svg Octicons simple.",
"scripts": {
"version": "../../script/rubyversion ./lib/octicons_helper/version.rb",
"postinstall": "bundle install --path vendor/bundle",
"prepare": "echo '(no prepare needed here)'",
"prepublishOnly": "../../script/notify pending && ../../script/gem_publish",
"publish": "../../script/notify success",
"test": "bundle exec rubocop && bundle exec rake"
......@@ -21,6 +22,6 @@
"rubygems": "octicons_helper",
"homepage": "https://github.com/primer/octicons#readme",
"dependencies": {
"octicons_gem": "8.0.0"
"octicons_gem": "8.1.0"
}
}
......@@ -14,5 +14,5 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency "jekyll", "~> 3.1"
s.add_dependency "octicons", "8.0.0"
s.add_dependency "octicons", "8.1.0"
end
......@@ -3,6 +3,6 @@ module Liquid; class Tag; end; end
module Jekyll
class Octicons < Liquid::Tag
VERSION = "8.0.0".freeze
VERSION = "8.1.0".freeze
end
end
{
"name": "jekyll-octicons",
"version": "8.0.0",
"version": "8.1.0",
"description": "A jekyll liquid plugin that makes including svg Octicons simple.",
"scripts": {
"version": "../../script/rubyversion ./lib/jekyll-octicons/version.rb",
......@@ -21,6 +21,6 @@
"rubygems": "jekyll-octicons",
"homepage": "https://github.com/primer/octicons#readme",
"dependencies": {
"octicons_gem": "8.0.0"
"octicons_gem": "8.1.0"
}
}
{
"version": "8.0.0",
"name": "octicons",
"version": "8.1.0",
"description": "A scalable set of icons handcrafted with <3 by GitHub.",
"homepage": "https://octicons.github.com",
"author": "GitHub Inc.",
......
......@@ -67,7 +67,7 @@ import React from 'react'
import Octicon, {getIconByName} from '@githubprimer/octicons-react'
export default function OcticonByName({name, ...props}) {
return <Octicon {...props} icon={getIcon(name)} />
return <Octicon {...props} icon={getIconByName(name)} />
}
```
......
{
"name": "@githubprimer/octicons-react",
"version": "8.0.0",
"version": "8.1.0",
"description": "A scalable set of icons handcrafted with <3 by GitHub.",
"homepage": "https://octicons.github.com",
"author": "GitHub, Inc.",
......@@ -10,12 +10,14 @@
"types": "dist/index.d.ts",
"repository": "primer/octicons",
"scripts": {
"pretest": "npm run lint && npm run ts-test",
"build": "script/build.js && script/types.js",
"pretest": "npm run lint",
"ts-test": "tsc -P ts-tests",
"test": "jest",
"posttest": "npm run ts-test",
"start": "NODE_ENV=production next",
"lint": "eslint src pages script",
"prepare": "script/build.js && script/types.js && npm run rollup",
"prepare": "npm run build && npm run rollup",
"prepublishOnly": "../../script/notify pending",
"preversion": "npm run prepare",
"publish": "../../script/notify success",
......
......@@ -7,6 +7,8 @@ const srcDir = resolve(__dirname, '../src/__generated__')
const iconsFile = join(srcDir, 'icons.js')
const typesFile = join(srcDir, 'icons.d.ts')
const GENERATED_HEADER = '/* THIS FILE IS GENERATED. DO NOT EDIT IT. */'
function CamelCase(str) {
return str.replace(/(^|-)([a-z])/g, (_, __, c) => c.toUpperCase())
}
......@@ -38,7 +40,7 @@ ${name}.size = [${width}, ${height}]
function writeIcons(file) {
const count = icons.length
const code = `/* THIS FILE IS GENERATED. DO NOT EDIT IT. */
const code = `${GENERATED_HEADER}
import React from 'react'
${icons.map(({code}) => code).join('\n')}
......@@ -64,7 +66,7 @@ export {
function writeTypes(file) {
const count = icons.length
const code = `/* THIS FILE IS GENERATED. DO NOT EDIT IT. */
const code = `${GENERATED_HEADER}
import * as React from 'react'
type Icon<
......@@ -81,7 +83,7 @@ declare const iconsByName: iconsByName
declare function getIconByName<T extends keyof iconsByName>(
name: T
): IconsByName[T];
): iconsByName[T];
declare function getIconByName(name: string): Icon | undefined
export {
......
......@@ -10,14 +10,17 @@ const destDir = resolve(__dirname, '../dist')
const iconsDest = join(destDir, 'icons.d.ts')
const indexDest = join(destDir, 'index.d.ts')
fse.copy(iconsSrc, iconsDest).catch(die)
fse
.readFile(indexSrc, 'utf8')
.then(content => content.replace(/.\/__generated__\//g, './'))
.then(fse.writeFile.bind(fse, indexDest))
.copy(iconsSrc, iconsDest)
.then(() => {
return fse
.readFile(indexSrc, 'utf8')
.then(content => content.replace(/.\/__generated__\//g, './'))
.then(content => fse.writeFile(indexDest, content, 'utf8'))
})
.catch(die)
function die(err) {
console.error(err.stack)
process.exit(1)
process.exitCode = 1
}
{
"private": true,
"scripts": {
"postinstall": "npm run bootstrap",
"bootstrap": "script/export && lerna bootstrap",
"test": "ava tests/*.js && lerna run test",
"bump": "lerna publish --exact --skip-npm --since \"v$(npm info octicons version)\""
......@@ -11,11 +12,13 @@
"devDependencies": {
"ava": "^0.22.0",
"commit-status": "^4.3.0",
"fs-extra": "^5.0.0",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",
"got": "^8.3.0",
"js-yaml": "^3.11.0",
"lerna": "2.9.0",
"ora": "^2.0.0",
"p-queue": "^2.4.2",
"svgo": "^1.0.5"
}
}
#!/bin/bash
set -e
if [[ "$CI" != "true" ]]; then
echo "(bailing: not in CI)"
exit
fi
branch=$TRAVIS_PULL_REQUEST_BRANCH
event=$TRAVIS_EVENT_TYPE
# only publish canary releases on PRs against dev
if [[ "$event" = "pull_request" ]] && [[ !("$branch" =~ ^release-.*) ]] && [[ !("$branch" = "master") ]];
then
echo "🐦 Publishing PR (canary) release..."
$(npm bin)/lerna publish --npm-tag=alpha --canary --exact --skip-git --yes
fi
#!/bin/bash
set -e
npm i
npm run bootstrap
npm install
This diff is collapsed.
#!/bin/bash
set -e
$(npm bin)/lerna publish --npm-tag=alpha --canary --exact --skip-git --yes
......@@ -3,7 +3,7 @@ set -e
# pwd
package=$(jq -r .name package.json)
version=$(jq -r .version package.json)
published=$(npm info $package@$version version)
published=$(npm info "$package@$version" version || echo "0.0.0")
if [[ "$version" = "$published" ]]; then
echo "⚠️ $package@$version is already published!"
else
......
const got = require('got')
const PQueue = require('p-queue')
const execa = require('execa')
const yaml = require('js-yaml')
const {readFileSync} = require('fs')
module.exports = {
progress: (current, total) => {
let percentage = Math.ceil((current * 10) / total)
let bar = [
"[", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "]",
` ${Math.ceil((current * 100) / total)}%`
]
for(let i = 1; i <= percentage; i++) {
bar[i] = "="
}
return bar.join("")
},
// this works around an issue with the TLS library that
// (apparently) every Node fetch() implementation uses
function fetchSSLFix(url) {
return execa('curl', ['-sL', url])
.then(res => res.stdout)
}
downloadSVG: (url, name, downloadProgress) => {
return new Promise(async (resolve, reject) => {
const response = await got.get(url, {
headers: { "Content-Type": "images/svg+xml" }
}).on('downloadProgress', downloadProgress)
function loadYAML(path) {
return yaml.safeLoad(readFileSync(path, 'utf8'))
}
resolve(response.body)
})
function progress(current, total) {
let percentage = Math.ceil((current * 10) / total)
let bar = [
"[", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "]",
` ${Math.ceil((current * 100) / total)}%`
]
for(let i = 1; i <= percentage; i++) {
bar[i] = "="
}
return bar.join("")
}
function queueTasks(tasks, options) {
const queue = new PQueue(Object.assign({concurrency: 3}, options))
for (const task of tasks) {
queue.add(task)
}
queue.start()
return queue.onIdle()
}
module.exports = {
fetchSSLFix,
loadYAML,
progress,
queueTasks
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment