Skip to content

Commit accdeb8

Browse files
committed
- [+] use GH actions for CD instead
1 parent 19ead5b commit accdeb8

4 files changed

Lines changed: 152 additions & 3 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main ]
17+
paths-ignore:
18+
- '**/*.md'
19+
pull_request:
20+
# The branches below must be a subset of the branches above
21+
branches: [ main ]
22+
paths-ignore:
23+
- '**/*.md'
24+
schedule:
25+
# The default branch at 14:32 UTC on the 1st of every month
26+
- cron: '32 14 1 * *'
27+
28+
jobs:
29+
analyze:
30+
name: Analyze
31+
runs-on: ubuntu-latest
32+
permissions:
33+
actions: read
34+
contents: read
35+
security-events: write
36+
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
language: [ 'go' ]
41+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
42+
# Learn more:
43+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
44+
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v2
48+
49+
# Initializes the CodeQL tools for scanning.
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@v1
52+
with:
53+
languages: ${{ matrix.language }}
54+
# If you wish to specify custom queries, you can do so here or in a config file.
55+
# By default, queries listed here will override any specified in a config file.
56+
# Prefix the list here with "+" to use these queries and those in the config file.
57+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v1
63+
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 https://git.io/JvXDl
66+
67+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
68+
# and modify them (or add more) to build your code if your project
69+
# uses a compiled language
70+
71+
#- run: |
72+
# make bootstrap
73+
# make release
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v1
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.15
19+
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
26+
-
27+
name: Tests
28+
run: |
29+
export GOPATH=/home/runner/go
30+
mkdir -p $GOPATH/src/github.com/$GITHUB_ACTOR
31+
mv $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_ACTOR
32+
ln -s $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
33+
# go mod tidy
34+
go get -v ./...
35+
go test -v ./...
36+
37+
-
38+
name: Run GoReleaser
39+
uses: goreleaser/goreleaser-action@v2
40+
if: success() && startsWith(github.ref, 'refs/tags/')
41+
with:
42+
version: latest
43+
args: release --rm-dist
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
project_name: html2md
2+
3+
archives:
4+
- format: tar.gz
5+
wrap_in_directory: true
6+
format_overrides:
7+
- goos: windows
8+
format: zip
9+
# remove README and LICENSE
10+
files:
11+
- none*
12+
13+
builds:
14+
- env: [CGO_ENABLED=0]
15+
goos:
16+
- linux
17+
- windows
18+
- darwin
19+
goarch:
20+
- amd64
21+
- arm64
22+
23+
nfpms:
24+
- maintainer: Tong Sun <suntong@cpan.org>
25+
description: HTML to Markdown converter
26+
homepage: https://github.com/suntong/html2md
27+
license: MIT
28+
formats:
29+
- deb
30+
- rpm
31+
- apk

.travis.yml

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

0 commit comments

Comments
 (0)