Skip to content

Commit f6c523e

Browse files
committed
Improve GH Actions, automate release, rm Travis
Switch from Travis to GitHub Actions, removing two dev dependencies. Release workflow for automated release.
1 parent b85bf6a commit f6c523e

File tree

8 files changed

+287
-996
lines changed

8 files changed

+287
-996
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: CodeQL
22

33
on:
44
push:

.github/workflows/publish.yml

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

.github/workflows/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
upgrade:
7+
description: Type of version upgrade (patch, minor, major)
8+
required: true
9+
default: patch
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2-beta
17+
with:
18+
node-version: 12
19+
registry-url: https://registry.npmjs.org/
20+
21+
- name: Setup git
22+
run: |-
23+
git config --global user.name "github-actions[bot]"
24+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
25+
26+
- run: npm version ${{ github.event.inputs.upgrade }}
27+
28+
- run: git push
29+
- run: git push --tags
30+
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
35+
- name: Prepare build
36+
run: npm i -g pkg
37+
38+
- name: Build
39+
run: pkg --out-path build .
40+
41+
- name: Get version and package name
42+
id: get_info
43+
run: |-
44+
version=$(node -p "require('./package.json').version")
45+
echo $version
46+
echo "::set-output name=version::$version"
47+
name=$(node -p "require('./package.json').name")
48+
echo $name
49+
echo "::set-output name=name::$name"
50+
51+
- name: Create Release
52+
id: create_release
53+
uses: actions/create-release@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
tag_name: v${{ steps.get_info.outputs.version }}
58+
release_name: Release v${{ steps.get_info.outputs.version }}
59+
draft: false
60+
prerelease: false
61+
62+
- name: Upload Linux Binary
63+
uses: actions/upload-release-asset@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
upload_url: ${{ steps.create_release.outputs.upload_url }}
68+
asset_path: ./build/${{ steps.get_info.outputs.name }}-linux
69+
asset_name: ${{ steps.get_info.outputs.name }}-linux
70+
asset_content_type: application/x-executable
71+
72+
- name: Upload MacOS Binary
73+
uses: actions/upload-release-asset@v1
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
with:
77+
upload_url: ${{ steps.create_release.outputs.upload_url }}
78+
asset_path: ./build/${{ steps.get_info.outputs.name }}-macos
79+
asset_name: ${{ steps.get_info.outputs.name }}-macos
80+
asset_content_type: application/x-mach-binary
81+
82+
- name: Upload Windows Binary
83+
uses: actions/upload-release-asset@v1
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
with:
87+
upload_url: ${{ steps.create_release.outputs.upload_url }}
88+
asset_path: ./build/${{ steps.get_info.outputs.name }}-win.exe
89+
asset_name: ${{ steps.get_info.outputs.name }}-win.exe
90+
asset_content_type: application/x-dosexec
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: GitHub CI
1+
name: Test
22

33
on: [push, pull_request]
44

@@ -16,7 +16,7 @@ jobs:
1616
node: 8
1717

1818
steps:
19-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v2
2020
- name: Use Node.js ${{matrix.node}}
2121
uses: actions/setup-node@v1
2222
with:
@@ -33,7 +33,7 @@ jobs:
3333
needs: test
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v1
36+
- uses: actions/checkout@v2
3737
- uses: actions/setup-node@v1
3838
with:
3939
node-version: 12

.travis.yml

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

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ It works with MacOS, Linux and Windows, on Chrome and Firefox, and requires you
66

77
[![NPM](https://nodei.co/npm/https-localhost.png)](https://nodei.co/npm/https-localhost/)
88

9-
[![Build Status](https://travis-ci.com/daquinoaldo/https-localhost.svg?branch=master)](https://travis-ci.com/daquinoaldo/https-localhost)
9+
[![Test](https://github.com/daquinoaldo/https-localhost/workflows/Test/badge.svg)](https://github.com/daquinoaldo/https-localhost/actions?query=workflow:Test)
1010
[![Coverage Status](https://coveralls.io/repos/github/daquinoaldo/https-localhost/badge.svg?branch=master)](https://coveralls.io/github/daquinoaldo/https-localhost?branch=master)
1111
[![Dependency Status](https://img.shields.io/david/daquinoaldo/https-localhost.svg)](https://david-dm.org/daquinoaldo/https-localhost)
1212
[![Known Vulnerabilities](https://snyk.io/test/npm/https-localhost/badge.svg)](https://snyk.io/test/npm/https-localhost)
1313
[![GitHub issues](https://img.shields.io/github/issues/daquinoaldo/https-localhost.svg)](https://github.com/daquinoaldo/https-localhost/issues)
14-
[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fdaquinoaldo%2Fhttps-localhost%2Fbadge)](https://actions-badge.atrox.dev/daquinoaldo/https-localhost/goto)
1514

1615

1716
## Dependencies

0 commit comments

Comments
 (0)