Skip to content

Commit d776828

Browse files
committed
Start GitHub CI
1 parent 2d88ab9 commit d776828

File tree

5 files changed

+315
-116
lines changed

5 files changed

+315
-116
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build and Snapshot Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * 0' # Weekly on Sunday at midnight
10+
workflow_dispatch: # Allows manual triggering
11+
12+
jobs:
13+
build:
14+
name: Build and Test on All Platforms
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
go-version: [">=1.23.5"]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
25+
- name: Set up Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: ${{ matrix.go-version }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: '3.x'
34+
35+
- name: Install dependencies
36+
run: go mod tidy -e || true
37+
38+
- name: Lint Go files
39+
run: go fmt ./...
40+
41+
- name: Run tests
42+
run: go test ./... -v
43+
44+
- name: Build binary
45+
run: python3 .github/workflows/build.py
46+
47+
- name: Upload artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: cf-cli-java-plugin-${{ matrix.os }}
51+
path: dist/
52+
53+
release:
54+
name: Create Snapshot Release
55+
needs: build
56+
runs-on: ubuntu-latest
57+
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
58+
59+
steps:
60+
- name: Download all artifacts
61+
uses: actions/download-artifact@v4
62+
with:
63+
path: dist/ # Specify the directory where artifacts will be downloaded
64+
65+
- name: Combine all artifacts
66+
run: |
67+
mkdir -p dist
68+
mv dist/*/* dist/ || true
69+
70+
- name: Create GitHub Release
71+
uses: softprops/action-gh-release@v1
72+
with:
73+
files: dist/*
74+
prerelease: true
75+
tag_name: snapshot
76+
body: |
77+
This is a snapshot release of the cf-cli-java-plugin.
78+
It includes the latest changes and is not intended for production use.
79+
Please test it and provide feedback.
80+
name: Snapshot Release
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os
2+
import platform
3+
4+
os.makedirs('dist', exist_ok=True)
5+
6+
os_name_map = {
7+
"Darwin": "macos",
8+
"Linux": "linux",
9+
"Windows": "windows"
10+
}
11+
os_name = os_name_map[platform.system()].lower()
12+
arch = platform.machine() # e.g., 'x86_64', 'arm64'
13+
print(f"Building for {os_name} {arch}")
14+
15+
os.system(f"go build -o dist/cf-cli-java-plugin-{os_name}-{arch}")

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Manual Release
2+
3+
on:
4+
workflow_dispatch: # Allows manual triggering
5+
6+
jobs:
7+
release:
8+
name: Create Proper Release on All Platforms
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
go-version: [">=1.23.5"]
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.x'
28+
29+
- name: Install dependencies
30+
run: go mod tidy -e || true
31+
32+
- name: Lint Go files
33+
run: go fmt ./...
34+
35+
- name: Run tests
36+
run: go test ./... -v
37+
38+
- name: Build binary
39+
run: python3 .github/workflows/build.py
40+
41+
- name: Create GitHub Release
42+
uses: softprops/action-gh-release@v1
43+
with:
44+
files: dist/*
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+

go.mod

Lines changed: 26 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module cf.plugin.ref/requires
22

3-
go 1.22.0
3+
go 1.23.0
44

55
toolchain go1.23.5
66

@@ -16,84 +16,55 @@ require (
1616

1717
require (
1818
code.cloudfoundry.org/bytefmt v0.0.0-20210608160410-67692ebc98de // indirect
19-
code.cloudfoundry.org/clock v1.0.0 // indirect
19+
code.cloudfoundry.org/cli-plugin-repo v0.0.0-20250414213145-88c4afe9cd65 // indirect
20+
code.cloudfoundry.org/go-log-cache v1.0.0 // indirect
21+
code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect
22+
code.cloudfoundry.org/gofileutils v0.0.0-20170111115228-4d0c80011a0f // indirect
23+
code.cloudfoundry.org/jsonry v1.1.4 // indirect
24+
code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect
2025
code.cloudfoundry.org/tlsconfig v0.0.0-20210615191307-5d92ef3894a7 // indirect
21-
github.com/BurntSushi/toml v0.3.1 // indirect
26+
code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d // indirect
2227
github.com/SermoDigital/jose v0.9.1 // indirect
2328
github.com/blang/semver v3.5.1+incompatible // indirect
2429
github.com/bmatcuk/doublestar v1.3.4 // indirect
25-
github.com/bramvdbogaerde/go-scp v1.0.0 // indirect
30+
github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect
2631
github.com/charlievieth/fs v0.0.1 // indirect
27-
github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89 // indirect
28-
github.com/chromedp/chromedp v0.9.2 // indirect
29-
github.com/chromedp/sysutil v1.0.0 // indirect
30-
github.com/chzyer/logex v1.2.1 // indirect
31-
github.com/chzyer/readline v1.5.1 // indirect
32-
github.com/chzyer/test v1.0.0 // indirect
3332
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible // indirect
3433
github.com/cloudfoundry/bosh-utils v0.0.264 // indirect
35-
github.com/cloudfoundry/go-socks5 v0.0.0-20180221174514-54f73bdb8a8e // indirect
36-
github.com/cloudfoundry/socks5-proxy v0.2.12 // indirect
3734
github.com/cppforlife/go-patch v0.2.0 // indirect
38-
github.com/davecgh/go-spew v1.1.1 // indirect
35+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
3936
github.com/fatih/color v1.12.0 // indirect
4037
github.com/fsnotify/fsnotify v1.4.9 // indirect
41-
github.com/go-logr/logr v1.4.2 // indirect
42-
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
43-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
44-
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
45-
github.com/gobwas/httphead v0.1.0 // indirect
46-
github.com/gobwas/pool v0.2.1 // indirect
47-
github.com/gobwas/ws v1.2.1 // indirect
48-
github.com/golang/protobuf v1.5.3 // indirect
38+
github.com/golang/protobuf v1.5.4 // indirect
4939
github.com/google/go-cmp v0.6.0 // indirect
50-
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
51-
github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c // indirect
52-
github.com/hpcloud/tail v1.0.0 // indirect
53-
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465 // indirect
40+
github.com/google/go-querystring v1.1.0 // indirect
41+
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
5442
github.com/jessevdk/go-flags v1.5.0 // indirect
55-
github.com/josharian/intern v1.0.0 // indirect
56-
github.com/jpillora/backoff v1.0.0 // indirect
57-
github.com/kr/pretty v0.2.1 // indirect
58-
github.com/kr/pty v1.1.1 // indirect
59-
github.com/kr/text v0.1.0 // indirect
60-
github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80 // indirect
43+
github.com/kr/pretty v0.3.1 // indirect
6144
github.com/lithammer/fuzzysearch v1.1.8 // indirect
6245
github.com/lunixbochs/vtclean v1.0.0 // indirect
63-
github.com/mailru/easyjson v0.7.7 // indirect
6446
github.com/mattn/go-colorable v0.1.8 // indirect
6547
github.com/mattn/go-isatty v0.0.12 // indirect
6648
github.com/mattn/go-runewidth v0.0.13 // indirect
67-
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
6849
github.com/nxadm/tail v1.4.8 // indirect
6950
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
70-
github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde // indirect
71-
github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20 // indirect
72-
github.com/pmezard/go-difflib v1.0.0 // indirect
7351
github.com/rivo/uniseg v0.2.0 // indirect
52+
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
7453
github.com/sirupsen/logrus v1.8.1 // indirect
75-
github.com/square/certstrap v1.2.0 // indirect
76-
github.com/stretchr/objx v0.5.0 // indirect
7754
github.com/stretchr/testify v1.8.4 // indirect
78-
github.com/tedsuo/ifrit v0.0.0-20191009134036-9a97d0632f00 // indirect
79-
github.com/urfave/cli v1.21.0 // indirect
55+
github.com/tedsuo/rata v1.0.0 // indirect
8056
github.com/vito/go-interact v1.0.0 // indirect
81-
github.com/yuin/goldmark v1.4.13 // indirect
82-
golang.org/x/crypto v0.31.0 // indirect
83-
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
84-
golang.org/x/mod v0.22.0 // indirect
85-
golang.org/x/net v0.33.0 // indirect
86-
golang.org/x/sync v0.10.0 // indirect
87-
golang.org/x/sys v0.28.0 // indirect
88-
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 // indirect
89-
golang.org/x/term v0.27.0 // indirect
90-
golang.org/x/text v0.21.0 // indirect
91-
golang.org/x/tools v0.28.0 // indirect
92-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
93-
google.golang.org/protobuf v1.36.1 // indirect
94-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
57+
golang.org/x/crypto v0.36.0 // indirect
58+
golang.org/x/net v0.37.0 // indirect
59+
golang.org/x/sys v0.32.0 // indirect
60+
golang.org/x/term v0.30.0 // indirect
61+
golang.org/x/text v0.23.0 // indirect
62+
google.golang.org/genproto v0.0.0-20250414145226-207652e42e2e // indirect
63+
google.golang.org/genproto/googleapis/api v0.0.0-20250409194420-de1ac958c67a // indirect
64+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250409194420-de1ac958c67a // indirect
65+
google.golang.org/grpc v1.71.0 // indirect
66+
google.golang.org/protobuf v1.36.6 // indirect
9567
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
96-
gopkg.in/fsnotify.v1 v1.4.7 // indirect
9768
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
9869
gopkg.in/yaml.v2 v2.4.0 // indirect
9970
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)