Skip to content

Commit

Permalink
ci: move to github action to publish on crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielsimard committed Jun 11, 2022
1 parent 6ea4f37 commit e08509b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 19 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: publish

on:
push:
tags:
- '*'

jobs:
publish:
name: publish
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: install rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: publish to crates.io
run: ./ci/publish.sh
env:
CRATES_IO_API_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Mock It
[![Build Status](https://travis-ci.org/nathanielsimard/mock-it.svg?branch=master)](https://travis-ci.org/nathanielsimard/mock-it)
[![codecov.io](https://codecov.io/gh/nathanielsimard/mock-it/coverage.svg?branch=master)](https://codecov.io/gh/nathanielsimard/mock-it)
[![Current Crates.io Version](https://img.shields.io/crates/v/mock-it.svg)](https://crates.io/crates/mock-it)

This library aims to make mocking reliable.
Expand Down
14 changes: 14 additions & 0 deletions ci/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "Publishing mock-it_codegen ..."
cd mock-it_codegen/
cargo publish --token ${CRATES_IO_API_TOKEN}
echo "Sucessfully published mock-it_codegen"

echo "Waiting 10 seconds for mock-it_codegen to be available ..."
sleep 10

echo "Publishing mock-it ..."
cd ../
cargo publish --token ${CRATES_IO_API_TOKEN}
echo "Sucessfully published mock-it"
3 changes: 3 additions & 0 deletions mock-it_codegen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Mock It Code Generation

Generate mocks based on traits for `mock-it`!

0 comments on commit e08509b

Please # to comment.