Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.4.0 #281

Merged
merged 96 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c3bb8f0
Deleting most of the current workflow and adding GitHub actions
jonrohan Jan 30, 2019
3417c19
Adding linting step
jonrohan Jan 30, 2019
a21af1c
Creating a version action
jonrohan Jan 30, 2019
23ed4b8
Creating a version action
jonrohan Jan 30, 2019
39f6fb9
Fix test linting
jonrohan Jan 30, 2019
f40bba7
removing npm packages that we don't use anymore
jonrohan Jan 30, 2019
63e06f1
Adding test to check that the svg files were downloaded
jonrohan Jan 30, 2019
942950d
lint needs install to work
jonrohan Jan 30, 2019
a9f7fed
Creating action for building node octicons packages
jonrohan Jan 30, 2019
44fc8fd
Commiting the package-lock and renaming index to css
jonrohan Jan 30, 2019
875bc33
Fixing all lint errors
jonrohan Jan 31, 2019
67e8662
We don't move the css anymore
jonrohan Jan 31, 2019
8303817
A couple of typos
jonrohan Jan 31, 2019
0e71c61
Adding a build step
jonrohan Jan 31, 2019
fd65532
Setting up build script for octicons_node
jonrohan Jan 31, 2019
2f918c9
Adding octicons_react workflow build
jonrohan Jan 31, 2019
a1ee6f3
require test instead of figma action
jonrohan Jan 31, 2019
646d229
Build before linting
jonrohan Jan 31, 2019
1528a95
Don't need to resolve test
jonrohan Jan 31, 2019
2612c16
Merge branch 'github_actions' into version_action
jonrohan Jan 31, 2019
c14f6e3
Adding octicons_gem to ruby build
jonrohan Jan 31, 2019
053dd1c
better branch name grab
jonrohan Jan 31, 2019
5fc303f
Update .github/actions/version/entrypoint.js
shawnbot Jan 31, 2019
039fdc3
Update .github/actions/version/entrypoint.js
shawnbot Jan 31, 2019
ce50698
Refactoring some logic
jonrohan Jan 31, 2019
407c40c
removing remotes/origin from regex
jonrohan Jan 31, 2019
745c8eb
Merge pull request #277 from primer/version_action
jonrohan Jan 31, 2019
4c9188c
Merge branch 'github_actions' into figma_action
jonrohan Jan 31, 2019
356d10c
moving this
jonrohan Jan 31, 2019
2966673
Merge pull request #278 from primer/figma_action
jonrohan Jan 31, 2019
10ac0ca
Merge branch 'github_actions' into node_build_action
jonrohan Jan 31, 2019
60a23e3
Merge branch 'github_actions' into ruby_build_action
jonrohan Jan 31, 2019
b1d7247
Setting version on repo
jonrohan Jan 31, 2019
ba84506
don't use jq
jonrohan Jan 31, 2019
68869d0
remove cat
jonrohan Jan 31, 2019
752b312
Fingers crossed publishing
jonrohan Jan 31, 2019
8e36e8d
exit
jonrohan Jan 31, 2019
c8cfe32
npmrc
jonrohan Jan 31, 2019
4caf950
Bail out of publishing
jonrohan Jan 31, 2019
d9c97ed
Tag canary builds with 0.0.0
jonrohan Jan 31, 2019
afb86ad
Why isn't this working
jonrohan Jan 31, 2019
882a0ed
remove the quotes
jonrohan Jan 31, 2019
523d13d
what is going on here
jonrohan Jan 31, 2019
1082136
Let's try regex
jonrohan Jan 31, 2019
2dc82b3
Getting shell script to work
jonrohan Jan 31, 2019
8b7a19b
test data
jonrohan Jan 31, 2019
eae3585
single bracket
jonrohan Jan 31, 2019
f68b954
quotes
jonrohan Jan 31, 2019
f91e748
try bash
jonrohan Jan 31, 2019
ccf0818
Works again
jonrohan Jan 31, 2019
34faa7f
Removing version package.json
jonrohan Jan 31, 2019
077b223
Merge pull request #279 from primer/node_build_action
jonrohan Jan 31, 2019
84258b1
Merge branch 'github_actions' into ruby_build_action
jonrohan Jan 31, 2019
9776a3e
Versioning and publishing
jonrohan Jan 31, 2019
331f5d2
make dir .gem
jonrohan Jan 31, 2019
eb6b9b1
Rubocop offense
jonrohan Jan 31, 2019
4988110
Commit file
jonrohan Feb 1, 2019
e30d0a3
Commit as mona
jonrohan Feb 1, 2019
10f6679
Set git config
jonrohan Feb 1, 2019
c67bca8
test without node
jonrohan Feb 1, 2019
4606bfc
use gem push ignore git
jonrohan Feb 1, 2019
95d3696
renaming
jonrohan Feb 1, 2019
e56417a
use the secret
jonrohan Feb 1, 2019
08033b4
differnt secret
jonrohan Feb 1, 2019
4a65ca5
cat
jonrohan Feb 1, 2019
9f642a2
do without test
jonrohan Feb 1, 2019
bef8867
Try it this way
jonrohan Feb 1, 2019
52eb7c7
Last try
jonrohan Feb 1, 2019
0f72253
update pre package versions for rubygems
jonrohan Feb 1, 2019
ad8659f
Adding octicons_helper to build
jonrohan Feb 1, 2019
d2b9887
versioning correctly and adding jekyll
jonrohan Feb 1, 2019
649b58b
circular deps
jonrohan Feb 1, 2019
13012d5
rake tasks for jekyll
jonrohan Feb 1, 2019
ef71d8a
adding bundle update
jonrohan Feb 1, 2019
d99a3d4
Add node projects back
jonrohan Feb 1, 2019
664d0db
Merge pull request #280 from primer/ruby_build_action
jonrohan Feb 1, 2019
1f4f276
Kicking off 8.4.0
jonrohan Feb 6, 2019
4bcaa08
Deleting more old script files
jonrohan Feb 8, 2019
393f6b6
Put svgo back and node slim in dockerfile
jonrohan Feb 8, 2019
00c6c04
Try getting version from jq
jonrohan Feb 8, 2019
3247da8
Using node slim here also
jonrohan Feb 8, 2019
f86cce0
Did these steps fail?
jonrohan Feb 8, 2019
34d72ab
Use jq in ruby also
jonrohan Feb 8, 2019
b168d79
Updating contributing docs
jonrohan Feb 8, 2019
472f062
Writing version script for contributing
jonrohan Feb 8, 2019
f1308d4
Merge pull request #276 from primer/github_actions
jonrohan Feb 8, 2019
9533150
8.4.0
jonrohan Feb 8, 2019
f2bedd9
Updating changelog
jonrohan Feb 8, 2019
d1d759b
Version before install
jonrohan Feb 8, 2019
e5557e7
Update the gemfile special case
jonrohan Feb 8, 2019
bb3e05a
see what's going on
jonrohan Feb 8, 2019
6e56d0b
Also update gemspec
jonrohan Feb 8, 2019
27e4062
small regex fix
jonrohan Feb 8, 2019
eb28928
capital changelog
jonrohan Feb 8, 2019
e9f41f0
Update .github/actions/version/entrypoint.js
shawnbot Feb 8, 2019
ef0cbc7
7 is the most magically significant number
jonrohan Feb 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Make sure your duplicate file can be viewed by others. In the share menu "Anyone

You can submit a pull request updating the `figma.url` configuration in the root [package.json](https://github.com/primer/octicons/blob/master/package.json#L10) with your figma file. Doing so will generate alpha releases of [all the libraries that distribute Octicons](https://github.com/primer/octicons#libraries).

If an icon was edited or added, you should see the before and after images directly in the PR. In addition, please describe your proposed changes in the PR's description.
If an icon was edited or added, you should see the before and after images directly in the PR. In addition, please describe your proposed changes in the PR's description.

Once the build passes on your pull request, you should see statuses with all the alpha versions of the libraries. You can then use these to test your changes.

Expand Down Expand Up @@ -59,9 +59,11 @@ Once the new changes have been added the new components to the master Octicons f

After you've published the latest changes in the Figma file, create a release branch in the [Octicons repo](https://github.com/primer/octicons).

Update the [changelog](https://github.com/primer/octicons/blob/master/CHANGELOG.md) with the new changes pertaining to this version.
Update the [CHANGELOG](https://github.com/primer/octicons/blob/master/CHANGELOG.md) with the new changes pertaining to this version.

Once the changlog has been updated, run `npm run bump`. This will guide you through a prompt asking what all the new versions of the packages should be. In the context of Octicons, significant changes to the library or workflow, or removing an icon would be considered a major update, adding a new icon would be considered a minor update, and fixing an icon would be considered a patch. Reach out in the #design-systems Slack channel if you're unsure!
Once the CHANGELOG has been updated, run `npm version <newversion>`. This will update package.json with the new version, then update all the `lib/*` packages with the same version. If that runs smoothly, it should commit the changed files. Push that commit to your release branch.
shawnbot marked this conversation as resolved.
Show resolved Hide resolved

In the context of Octicons, significant changes to the library or workflow, or removing an icon would be considered a major update, adding a new icon would be considered a minor update, and fixing an icon would be considered a patch. Reach out in the #design-systems Slack channel if you're unsure!

After, push up your branch and open a pull request into master.

Expand Down
10 changes: 10 additions & 0 deletions .github/actions/build_node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:10-slim

RUN apt-get update && \
apt-get install --no-install-recommends -y \
jq && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
shawnbot marked this conversation as resolved.
Show resolved Hide resolved

ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
51 changes: 51 additions & 0 deletions .github/actions/build_node/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash -l

set -e

if [ -n "$NPM_AUTH_TOKEN" ]; then
# Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}"
NPM_REGISTRY_URL="${NPM_REGISTRY_URL-registry.npmjs.org}"

# Allow registry.npmjs.org to be overridden with an environment variable
printf "//%s/:_authToken=%s\\nregistry=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "$NPM_REGISTRY_URL" > "$NPM_CONFIG_USERCONFIG"
chmod 0600 "$NPM_CONFIG_USERCONFIG"
fi

PACKAGE_VERSION=$(jq '.version' --raw-output ./package.json)

echo "************* Building v$PACKAGE_VERSION *************"

PUBLISH_TAG=latest
if [[ "$PACKAGE_VERSION" =~ ^0\.0\.0\- ]]
then
PUBLISH_TAG=canary
elif [[ "$PACKAGE_VERSION" =~ \-rc ]]
then
PUBLISH_TAG=next
fi

cd ./lib/$*

echo "**************** Copying assets files to build directory ****************"
cp -R ../build/ .

echo "**************** Installing ****************"
npm install

echo "**************** Building ****************"
npm run build

echo "**************** Linting ****************"
npm run lint

echo "**************** Testing ****************"
npm run test

{
echo "**************** Publishing ****************"
npm version $PACKAGE_VERSION && npm publish --tag $PUBLISH_TAG --access public
} || {
# Bail out of publishing
exit 0
}
10 changes: 10 additions & 0 deletions .github/actions/build_ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ruby:2.6.0

RUN apt-get update && \
apt-get install --no-install-recommends -y \
jq && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*

ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
42 changes: 42 additions & 0 deletions .github/actions/build_ruby/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash -l

set -e

PACKAGE_VERSION=$(jq '.version' --raw-output ./package.json)

PACKAGE_VERSION=$(echo $PACKAGE_VERSION | sed -e 's/^0\.0\.0./0.0.0.pre./g')
PACKAGE_VERSION=$(echo $PACKAGE_VERSION | sed -e 's/-rc/.pre/g')

echo "************* Building v$PACKAGE_VERSION *************"

# Setup rubygems creds
mkdir -p ~/.gem
cat << EOF > ~/.gem/credentials
---
:rubygems_api_key: ${RUBYGEMS_TOKEN}
EOF
chmod 0600 ~/.gem/credentials

cd ./lib/$*

echo "**************** Copying assets files to build directory ****************"
cp -R ../build lib/

perl -pi -e "s/\"octicons\", \"[^\"]+\"/\"octicons\", \"${PACKAGE_VERSION}\"/" ./Gemfile ./*.gemspec

echo "**************** Installing ****************"
bundle install

echo "**************** Linting ****************"
bundle exec rake lint

echo "**************** Testing ****************"
bundle exec rake test

echo "**************** Versioning ****************"
bundle exec rake version\["$PACKAGE_VERSION"\]

bundle update

echo "**************** Building ****************"
(bundle exec rake build; gem push pkg/*.gem) && wait
7 changes: 7 additions & 0 deletions .github/actions/version/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:10-slim

WORKDIR /
COPY . /
RUN npm install

ENTRYPOINT [ "node", "/entrypoint.js" ]
37 changes: 37 additions & 0 deletions .github/actions/version/entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const fs = require('fs')
const {
resolve
} = require('path')
const {
GITHUB_REF,
GITHUB_SHA
} = process.env

// Octicons package
const pkg = require(resolve(process.cwd(), 'package.json'))

// GitHub info
const branchName = GITHUB_REF.replace('refs/heads/', '')
const shortSha = GITHUB_SHA.slice(0,7)
let releaseMatch = null

const writePackageJson = () => {
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2), 'utf8')
}

// If it's a release branch
if (releaseMatch = branchName.match(/^release-([\d\.]+)/i)) {
console.log('Versioning release candidate')
console.log(`${pkg.version} => ${releaseMatch[1]}`)
pkg.version = `${releaseMatch[1]}-rc.${shortSha}`
writePackageJson()
}

// Otherwise
else if (branchName != 'master') {
const newVersion = `0.0.0-${shortSha}`
console.log('Versioning prerelease')
console.log(`${pkg.version} => ${newVersion}`)
pkg.version = newVersion
writePackageJson()
}
92 changes: 92 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
workflow "Octicons" {
on = "push"
resolves = [
"Build & Deploy node.js",
"Build & Deploy react",
"Build & Deploy rubygem",
"Build & Deploy rails helper",
"Build & Deploy jekyll plugin"
]
}

action "Install" {
uses = "actions/npm@master"
args = "install"
}

action "Version" {
needs = ["Install"]
uses = "./.github/actions/version"
}

action "Lint" {
needs = ["Install"]
uses = "actions/npm@master"
args = "run lint"
}

action "Test" {
needs = ["Lint", "Export SVG from Figma"]
uses = "actions/npm@master"
args = "test"
}

action "Export SVG from Figma" {
needs = ["Version"]
uses = "primer/figma-action@master"
secrets = [
"FIGMA_TOKEN"
]
env = {
"FIGMA_FILE_URL" = "https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons"
}
args = [
"format=svg",
"dir=./lib/build"
]
}

action "Build & Deploy node.js" {
needs = ["Test"]
uses = "./.github/actions/build_node"
args = "octicons_node"
secrets = [
"NPM_AUTH_TOKEN"
]
}

action "Build & Deploy react" {
needs = ["Test"]
uses = "./.github/actions/build_node"
args = "octicons_react"
secrets = [
"NPM_AUTH_TOKEN"
]
}

action "Build & Deploy rubygem" {
needs = ["Test"]
uses = "./.github/actions/build_ruby"
args = "octicons_gem"
secrets = [
"RUBYGEMS_TOKEN"
]
}

action "Build & Deploy rails helper" {
needs = ["Build & Deploy rubygem"]
uses = "./.github/actions/build_ruby"
args = "octicons_helper"
secrets = [
"RUBYGEMS_TOKEN"
]
}

action "Build & Deploy jekyll plugin" {
needs = ["Build & Deploy rubygem"]
uses = "./.github/actions/build_ruby"
args = "octicons_jekyll"
secrets = [
"RUBYGEMS_TOKEN"
]
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
.bundle
.env
node_modules
lib/*/package-lock.json
vendor

# Ignore build/export artifacts
Expand Down
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 8.4.0

### :house: Internal
- Using Actions to build and deploy Octicons https://github.com/primer/octicons/pull/276

#### Committers: 1
- Jon Rohan ([jonrohan](https://github.com/jonrohan))

# 8.3.0

- New "changes requested" icon https://github.com/primer/octicons/pull/267
Expand Down
11 changes: 0 additions & 11 deletions lerna.json

This file was deleted.

13 changes: 13 additions & 0 deletions lib/octicons_gem/Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
require "rake/testtask"
require "rubocop/rake_task"
require "bundler/gem_tasks"

RuboCop::RakeTask.new(:lint) do |t|
t.options = ["--display-cop-names"]
end

Rake::TestTask.new do |t|
t.libs = ["lib", "test"]
t.test_files = FileList["test/*_test.rb"]
end

task :version, [:v] do |t, args|
out = "module Octicons\n"\
" VERSION = \"#{args[:v]}\".freeze\n"\
"end"
File.open(File.expand_path("../lib/octicons/version.rb", __FILE__), "w") { |file| file.puts out }
end

desc "Run tests"
task default: :test
2 changes: 1 addition & 1 deletion lib/octicons_gem/lib/octicons/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Octicons
VERSION = "8.3.0".freeze
VERSION = "8.4.0".freeze
end
21 changes: 0 additions & 21 deletions lib/octicons_gem/package.json

This file was deleted.

Loading