Skip to content

Commit 453c59a

Browse files
committed
Migrate from Travis to GitHub Actions
1 parent 248db4f commit 453c59a

File tree

3 files changed

+107
-50
lines changed

3 files changed

+107
-50
lines changed

.github/workflows/main.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: main
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
fetch-depth: 0 # Need all tags to get a version number in-between tags
11+
- uses: actions/setup-node@v2-beta
12+
- run: yarn --frozen-lockfile
13+
- run: yarn build-demo
14+
- uses: actions/upload-artifact@v2
15+
with:
16+
name: dist
17+
path: dist/
18+
19+
test:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-node@v2-beta
24+
- run: yarn --frozen-lockfile
25+
- run: ./node_modules/.bin/ng test fab-speed-dial --progress false --watch=false --browsers ChromeHeadlessCustom
26+
- run: ./node_modules/.bin/ng test demo --progress false --watch=false --browsers ChromeHeadlessCustom
27+
28+
lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-node@v2-beta
33+
- run: yarn --frozen-lockfile
34+
- run: yarn lint
35+
36+
prettier:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: actions/setup-node@v2-beta
41+
- run: yarn --frozen-lockfile
42+
- run: ./node_modules/.bin/prettier --check .
43+
44+
publish-demo:
45+
runs-on: ubuntu-latest
46+
needs:
47+
- build
48+
- test
49+
steps:
50+
- uses: actions/download-artifact@v2
51+
with:
52+
name: dist
53+
path: dist/
54+
- uses: crazy-max/ghaction-github-pages@v2
55+
with:
56+
build_dir: dist/demo
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
60+
release:
61+
runs-on: ubuntu-latest
62+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
63+
needs:
64+
- build
65+
- test
66+
steps:
67+
- uses: actions/checkout@v2
68+
with:
69+
ref: ${{ github.ref }} # Otherwise our annotated tag is not fetched and we cannot get correct version
70+
- uses: actions/download-artifact@v2
71+
with:
72+
name: dist
73+
path: dist/
74+
- run: rm .gitignore
75+
76+
# Publish to npm
77+
- uses: actions/setup-node@v2-beta
78+
with:
79+
registry-url: 'https://registry.npmjs.org'
80+
- run: npm publish --access public dist/fab-speed-dial
81+
env:
82+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
83+
84+
# Publish to GitHub Packages
85+
- uses: actions/setup-node@v2-beta
86+
with:
87+
registry-url: 'https://npm.pkg.github.com'
88+
- run: npm publish --access public dist/fab-speed-dial
89+
env:
90+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
# Create release
93+
- name: Get release info
94+
id: release-info
95+
run: |
96+
echo "::set-output name=subject::$(git tag --format '%(contents:subject)' --points-at)"
97+
git tag --format '%(contents:body)' --points-at > release-body.txt
98+
- uses: actions/create-release@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
101+
with:
102+
tag_name: ${{ github.ref }}
103+
release_name: ${{ steps.release-info.outputs.subject }}
104+
body_path: release-body.txt

.travis.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Angular Material FAB speed dial
22

3-
[![Build Status](https://travis-ci.com/Ecodev/fab-speed-dial.svg?branch=master)](https://travis-ci.com/Ecodev/fab-speed-dial)
3+
[![Build Status](https://github.com/Ecodev/fab-speed-dial/workflows/main/badge.svg)](https://github.com/Ecodev/fab-speed-dial/actions)
44
[![Total Downloads](https://img.shields.io/npm/dt/@ecodev/fab-speed-dial.svg)](https://www.npmjs.com/package/@ecodev/fab-speed-dial)
55
[![Latest Stable Version](https://img.shields.io/npm/v/@ecodev/fab-speed-dial.svg)](https://www.npmjs.com/package/@ecodev/fab-speed-dial)
66
[![License](https://img.shields.io/npm/l/@ecodev/fab-speed-dial.svg)](https://www.npmjs.com/package/@ecodev/fab-speed-dial)
@@ -66,8 +66,8 @@ In case of buttons, the icon should rotate not the whole button (box-shadow woul
6666
The most useful commands for development are:
6767

6868
- `yarn dev` to start a development server
69-
- `yarn build-demo` to build the demo locally (it will be published automatically by Travis)
70-
- `git tag -a 1.2.3 && git push` to publish the lib to npm (via Travis deploy mechanism)
69+
- `yarn build-demo` to build the demo locally (it will be published automatically by GitHub Actions)
70+
- `git tag -a 1.2.3 && git push` to publish the lib to npm (via GitHub Actions `release` job)
7171

7272
## Prior work
7373

0 commit comments

Comments
 (0)