Skip to content

Commit 85aadab

Browse files
committed
Add workflows
1 parent 2e11931 commit 85aadab

3 files changed

Lines changed: 96 additions & 2 deletions

File tree

.github/workflows/build.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: build
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
test:
11+
uses: ./.github/workflows/test.yaml
12+
permissions: write-all
13+
release:
14+
needs:
15+
- test
16+
name: make release
17+
permissions: write-all
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
24+
- name: Make github config
25+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/make_github_config.sh
26+
| bash
27+
- name: Install Go
28+
env:
29+
TARGET_FOLDER: /home/runner/.local/go
30+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_install.sh
31+
| bash
32+
- name: Add packages in sub folders to GOROOT
33+
env:
34+
GOROOT: /home/runner/.local/go
35+
SOURCE_FOLDER: src
36+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_add_sub_packages.sh
37+
| bash
38+
- name: Build
39+
env:
40+
GOROOT: /home/runner/.local/go
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
# APP_NAME: none
43+
SOURCE_FOLDER: src
44+
# TARGET_FOLDER: build
45+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_build.sh
46+
| bash
47+
- name: Gzip assets
48+
# env:
49+
# SOURCE_FOLDER: build
50+
# TARGET_FOLDER: /tmp/assets
51+
# VERSION_COMMAND: date +%y.%m.%d
52+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/gzip_builds.sh
53+
| bash
54+
- if: ${{ !env.ACT }}
55+
name: Upload release binaries
56+
uses: alexellis/upload-assets@0.3.0
57+
env:
58+
GITHUB_TOKEN: ${{ github.token }}
59+
with:
60+
asset_paths: '["/tmp/assets/*"]'

.github/workflows/test.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: test
3+
4+
on:
5+
push:
6+
branches: ["master"]
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
test:
12+
name: go test
13+
permissions: write-all
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- name: Install Go
21+
env:
22+
TARGET_FOLDER: /home/runner/.local/go
23+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_install.sh
24+
| bash
25+
- name: Add packages in sub folders to GOROOT
26+
env:
27+
GOROOT: /home/runner/.local/go
28+
SOURCE_FOLDER: src
29+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_add_sub_packages.sh
30+
| bash
31+
- name: run tests
32+
env:
33+
GOROOT: /home/runner/.local/go
34+
SOURCE_FOLDER: src
35+
run: curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_test.sh
36+
| bash

readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# IPex
22

3-
## Synopsis
4-
53
A fast and simple string parser that returns an IP address or a list of them. Accepts CIDR notation or IP fragments. If base IP is not set, unlike in the examples below, the IP of the machine which runs the script is used.
64

75
```go mdox-exec="sh/demo.sh"

0 commit comments

Comments
 (0)