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

Improve release (superseeds #20) #21

Merged
merged 33 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
561a727
Add the first draft of a changelog
tmattio Jan 2, 2020
fe22cae
Extract why to a standalone document
tmattio Jan 2, 2020
646adc5
Inline list of official templates
tmattio Jan 2, 2020
2ca1a37
Add some elements to the roadmap
tmattio Jan 3, 2020
f28fdae
Add namespace in front of the formula
tmattio Jan 4, 2020
5e09502
Fix readme install instructions
tmattio Jan 4, 2020
fd9ea12
Bump homebrew install
tmattio Jan 11, 2020
6cb41b8
Fix wrong error code
tmattio Jan 12, 2020
75ee564
Change env var doc
tmattio Jan 12, 2020
806e41b
Attempt to workaround yarn issue
tmattio Jan 12, 2020
8b65d10
Change release to use a postinstall script with a dummy file
tmattio Jan 12, 2020
998d6d7
Temporarily allow release from branch
tmattio Jan 12, 2020
802d2ad
Bump to 0.4.4
tmattio Jan 12, 2020
bb2e954
Update lockfiles
tmattio Jan 12, 2020
3f80591
Redirect git logs to dev null
tmattio Jan 12, 2020
2dc2e62
Fix change directory commands
tmattio Jan 12, 2020
cde18c3
Run npm publish in subdirectory
tmattio Jan 12, 2020
a378305
Release demo
tmattio Jan 12, 2020
3de61c7
Use double quotes for js scripts
tmattio Jan 12, 2020
38eb0a1
Complete changelog for missing versions
tmattio Jan 12, 2020
1efc518
Update spin config file
tmattio Jan 12, 2020
ec587da
Rename record script to follow convention
tmattio Jan 12, 2020
e380951
Cleanup a few configurations
tmattio Jan 12, 2020
0f96067
Update ignore files
tmattio Jan 12, 2020
3466884
Try to fix release by using working-directory
tmattio Jan 12, 2020
8770ee0
Add cache and fix missing platform file
tmattio Jan 12, 2020
7c03a95
Remove version 0.4.4
tmattio Jan 12, 2020
2d15c73
Hardcode npm api with token
tmattio Jan 12, 2020
cca0931
Revert to a simplistic caching system
tmattio Jan 12, 2020
edcbec6
Log github reference
tmattio Jan 12, 2020
c238dc4
Regenerate demo
tmattio Jan 12, 2020
ee92486
Bump to 0.4.4
tmattio Jan 12, 2020
b446f2c
Add back branch check on release
tmattio Jan 12, 2020
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
18 changes: 4 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
# TODO(tmattio) - Fix windows build
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
node-version: [12.x]
steps:
- uses: actions/checkout@v1

- name: Use Node.js 12.x
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: ${{ matrix.node-version }}

- name: Cache esy dependencies
uses: actions/cache@v1
Expand All @@ -50,18 +51,7 @@ jobs:
run: esy build

- name: Check formatting
run: |
esy format
if [ -n "$(git status --porcelain)" ]; then
echo "There are differences:"
git status --porcelain
echo "----"
echo ""
echo 'Please run `esy format` locally to fix the issues.'
exit 1
fi
# Run formatting check only once
if: matrix.os == 'ubuntu-latest'
run: esy dune build @fmt

- name: Run tests
run: esy test
Expand Down
100 changes: 58 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,35 @@ jobs:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
steps:
- name: Log Github reference
run: echo "Checking out ${{ github.ref }}"

- uses: actions/checkout@v1

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: "https://registry.npmjs.org"

- name: Cache esy dependencies
uses: actions/cache@v1
id: cache
with:
path: _export
key: ${{ runner.OS }}-build-${{ hashFiles('esy.lock/index.json') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-

- name: Install esy
run: npm install -g @esy-nightly/esy@latest

- name: Import dependencies
if: steps.cache.outputs.cache-hit == 'true'
run: esy import-build _export/*

- name: Install dependencies
run: esy install

Expand All @@ -34,6 +53,9 @@ jobs:
- name: Run tests
run: esy test

- name: Export dependencies
run: esy export-dependencies

- name: Get Esy binary path
id: esy_binary_path
shell: bash
Expand All @@ -59,58 +81,47 @@ jobs:
steps:
- uses: actions/checkout@v1

- uses: actions/setup-node@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
node-version: 12.x

- name: Make NPM release skeleton
run: node scripts/release-make-skeleton.js

- name: Download linux artifacts
uses: actions/download-artifact@master
with:
name: ubuntu-latest
path: binaries/linux
path: _release/platform-linux-x64

- name: Download macOS artifacts
uses: actions/download-artifact@master
with:
name: macos-latest
path: binaries/darwin
path: _release/platform-darwin-x64

# TODO(tmattio) - Fix windows build
# - name: Download windows artifacts
# uses: actions/download-artifact@master
# with:
# name: windows-latest
# path: binaries/windows

- name: Move artifacts for NPM
run: |
mkdir -p bin
cp binaries/darwin/spin.exe bin/spin-darwin-x64.exe
# TODO(tmattio) - Fix windows build
# cp binaries/windows/spin.exe bin/spin-win-x64.exe
cp binaries/linux/spin.exe bin/spin-linux-x64.exe
# path: _release/platform-windows-x64

- name: Create archives for Github release
run: |
mkdir -p gh-release-darwin-x64
cp binaries/darwin/spin.exe gh-release-darwin-x64/spin
cd gh-release-darwin-x64
zip -r ../spin-darwin-x64.zip .
cd ..
cd _release/platform-darwin-x64
zip -r ../../spin-darwin-x64.zip .
cd ../..

cd _release/platform-linux-x64
zip -r ../../spin-linux-x64.zip .
cd ../..

# TODO(tmattio) - Fix windows build
# mkdir -p gh-release-win-x64
# cp binaries/darwin/spin.exe gh-release-win-x64/spin
# cd gh-release-win-x64
# zip -r ../spin-win-x64.zip .
# cd ..

mkdir -p gh-release-linux-x64
cp binaries/linux/spin.exe gh-release-linux-x64/spin
cd gh-release-linux-x64
zip -r ../spin-linux-x64.zip .
cd ..
# cd _release/platform-windows-x64
# zip -r ../../spin-windows-x64.zip .
# cd ../..

- name: Create Github release
id: create_release
Expand All @@ -133,17 +144,6 @@ jobs:
asset_name: spin-darwin-x64.zip
asset_content_type: application/gzip

# TODO(tmattio) - Fix windows build
# - name: Upload spin-win-x64.zip to Github release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: spin-win-x64.zip
# asset_name: spin-win-x64.zip
# asset_content_type: application/gzip

- name: Upload spin-linux-x64.zip to Github release
uses: actions/[email protected]
env:
Expand All @@ -154,7 +154,23 @@ jobs:
asset_name: spin-linux-x64.zip
asset_content_type: application/gzip

# TODO(tmattio) - Fix windows build
# - name: Upload spin-windows-x64.zip to Github release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: spin-windows-x64.zip
# asset_name: spin-windows-x64.zip
# asset_content_type: application/gzip

- name: Publish NPM package
run: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm config set scope "@tmattio"
npm config list
npm publish --access public
working-directory: ./_release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
npm-debug.log
.merlin
yarn-error.log
node_modules
node_modules/
_build
_generated
_release
_export
_build/
_generated/
_release/
_export/
_esy/
spin.install
.DS_Store
Expand Down
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

6 changes: 3 additions & 3 deletions .spin
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(source /Users/tmattio/Workspaces/spin-templates/cli)
(source cli)

(cfg_str project_name Spin)
(cfg_str project_slug spin)
(cfg_str syntax Reason)
(cfg_str ci_cd "Github Actions")
(cfg_str project_description "")
(cfg_str syntax Reason)
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.4.3] - 2020-11-01

### Changed

- Redirect stderr to dev null when calling git commands.

### Fixed

- Fix a wrong exit code when calling a generator that does not exist.
- Rename Homebrew formula to prevent duplication with existing `spin` formula.
- Fix installation from NPM using `yarn`

## [0.4.2] - 2020-02-01

### Fixed

- Fix release artifacts on linux that was using darwin binaries.

## [0.4.1] - 2020-02-01

### Changed

- Use master branch of `spin-templates`.
- The template argument in `spin new` is not required. To use the minimal template, you can run `spin new native`.

### Fixed

- Use HTTPS instead of SSH to clone `spin-templates`.
- Remove duplicated git clone logs.

## [0.4.0] - 2020-02-01

### Added

- Create new projects from official templates with `spin new TEMPLATE`.
- Create new projects from git repositories with `spin new TEMPLATE`.
- Create new minimal projects with `spin new` when no argument is provided.
- Generate new modules in existing Spin projects with `spin gen [GENERATOR]`.
- List existing official templates with `spin ls`.
- Install with Homebrew.
- Install with a bash script.

[Unreleased]: https://github.com/tmattio/spin/compare/v0.4.3...HEAD
[0.4.3]: https://github.com/tmattio/spin/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/tmattio/spin/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/tmattio/spin/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/tmattio/spin/releases/tag/v0.4.0
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

<p align="center">
<a href="#features">Features</a> •
<a href="#why">Why</a> •
<a href="#installation">Installation</a> •
<a href="#templates">Templates</a> •
<a href="#usage">Usage</a> •
Expand All @@ -24,7 +23,7 @@
</p>

<div align="center">
<img src="./docs/demo.svg" alt="Demo">
<img src="docs/demo.svg" alt="Demo">
</div>

## Features
Expand All @@ -37,20 +36,12 @@

🔌 Establish a convention for projects organizations to make it easy to get into new projects.

## Why?

Reason and OCaml are by far my favourite languages! I've also worked on Elixir projects and saw with my own eyes how productive (and happy!) you can be with great toolings. I wish I had the best of both worlds: working with Reason and Ocaml and having a tooling worthy of Ruby-on-Rails.

On another hand, I spend a large part of my time working on deployment pipelines, databases, micro-service communication, etc. It's hard to see how this aligns with the value of the product I work on, especially when it seems that I am doing the same things over and over again. I wanted to reduce the time I spend on this kind of thing.

Finally, another characteristic of Elixir and RoR ecosystems that I envy: all the projects have the same structure and use the same conventions. This is very powerful, and they achieve this by having official real-world templates. I hope Reason and OCaml communities will come to this one day, but of course, the community adoption of Spin is outside of my control, all I can do is build great templates that people enjoy! 😁

## Installation

### Using Homebrew (macOS)

```bash
brew install https://raw.githubusercontent.com/tmattio/spin/master/scripts/spin.rb
brew install https://raw.githubusercontent.com/tmattio/spin/master/scripts/tmattio-spin.rb
```

<!-- ### Using Chocolatey (Windows)
Expand All @@ -70,22 +61,34 @@ npm -g install @tmattio/spin
### Using a script

```bash
curl -fsSL https://github.com/tmattio/spin/raw/master/dist/install.sh | bash
curl -fsSL https://github.com/tmattio/spin/raw/master/scripts/install.sh | bash
```

## Templates

Anyone can create new Spin templates, but we provide official templates for a lot of use cases.

You can see the list of official templates [here](https://github.com/tmattio/spin-templates) or by using `spin ls`.

You can generate a new project using a template with `spin new`. For instance:

```bash
spin new react my_app
spin new native my_app
```

Will create a new React application in the directory `./my_app/`
Will create a new native application in the directory `./my_app/`

Anyone can create new Spin templates, but we provide official templates for a lot of use cases. The official templates for each type of applications are listed below.

### Templates for native applications

- **[native](https://github.com/tmattio/spin-templates/tree/master/native)** - A native project containing the minimum viable configurations.
- **[cli](https://github.com/tmattio/spin-templates/tree/master/cli)** - Native command line interface.

### Templates for web applications

- **[react](https://github.com/tmattio/spin-templates/tree/master/react)** - React Single-Page-Application in Reason.

### Templates for hybrid applications

- **[lib](https://github.com/tmattio/spin-templates/tree/master/lib)** - A library to be used in native or web applications.
- **[ppx](https://github.com/tmattio/spin-templates/tree/master/ppx)** - A PPX library to be used in native or web applications.

## Usage

Expand Down Expand Up @@ -246,5 +249,10 @@ The following snippet describes Spin's repository structure.
- **rest-api** - HTTP server that serves a REST API.
- **react-components** - React component library with Storybook.
- **bs-bindings** - Bucklescript bindings to Javascript libraries.
- Support more CI/CD
- Gitlab
- Azure
- Google Build
- Bitbucket Pipeline
- Create infrastructure of generated projects (i.e. generate terraform code)
- Write tutorials for the templates (e.g. Add user authentication for graphql-api)
2 changes: 1 addition & 1 deletion bin/package.re
Original file line number Diff line number Diff line change
@@ -1 +1 @@
let version = "0.4.2";
let version = "0.4.4";
Loading