-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit eda1020
Showing
12 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: read | ||
env: | ||
PKGFORGE_STATEFILE: /tmp/pkgforge | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Build | ||
run: make | ||
- name: Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Post to a Slack channel | ||
if: ${{ failure() }} | ||
uses: slackapi/slack-github-action@v1.23.0 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
with: | ||
payload: | | ||
{ | ||
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*${{ github.repository }}*\nBuild failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.gopath | ||
/bin | ||
/vendor/ | ||
/pkg/ | ||
/payload.zip | ||
/.tools/ | ||
/Dockerfile | ||
/smoosh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "meta"] | ||
path = meta | ||
url = https://github.com/akerl/pkgforge-golang-helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name 'prospectus-script' | ||
org 'akerl' | ||
|
||
source( | ||
type: 'git', | ||
path: '.' | ||
) | ||
|
||
build do | ||
run 'make local' | ||
cp 'bin' | ||
end | ||
|
||
package( | ||
type: 'file', | ||
artifacts: %w(darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64).map do |x| | ||
os, arch = x.split '/' | ||
filename = "#{@forge.name}_#{os}_#{arch}" | ||
{ | ||
source: "bin/#{filename}", | ||
name: filename | ||
} | ||
end | ||
) | ||
|
||
test do | ||
# TODO: add tests | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2023 Les Aker | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include meta/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PACKAGE = prospectus-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
prospectus-static | ||
========= | ||
|
||
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/akerl/prospectus-static/build.yml?branch=main)](https://github.com/akerl/prospectus-static/actions) | ||
[![GitHub release](https://img.shields.io/github/release/akerl/prospectus-static.svg)](https://github.com/akerl/prospectus-static/releases) | ||
[![License](https://img.shields.io/github/license/akerl/prospectus-static)](https://github.com/akerl/prospectus-static/blob/master/LICENSE) | ||
|
||
## Usage | ||
|
||
## Installation | ||
|
||
``` | ||
go install github.com/akerl/prospectus-static@latest | ||
``` | ||
|
||
## License | ||
|
||
prospectus-static is released under the MIT License. See the bundled LICENSE file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module github.com/akerl/prospectus-static | ||
|
||
go 1.19 | ||
|
||
require github.com/akerl/prospectus/v3 v3.0.0 | ||
|
||
require ( | ||
github.com/ghodss/yaml v1.0.0 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
github.com/akerl/prospectus/v3 v3.0.0 h1:99fAifpUmx2Ci38kM7bFSVOpYnognIwIfsrIVrD+0+8= | ||
github.com/akerl/prospectus/v3 v3.0.0/go.mod h1:9kryC2hxZtzi2SKI/UIBgXVOx0hladf2qDzkcW+xMe0= | ||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= | ||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= | ||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/akerl/prospectus/v3/plugin" | ||
) | ||
|
||
type config struct { | ||
Value string `json:"value"` | ||
} | ||
|
||
func run(cfg config) error { | ||
if cfg.Value == "" { | ||
return fmt.Errorf("required arg not provided: value") | ||
} | ||
|
||
fmt.Printf(cfg.Value) | ||
return nil | ||
} | ||
|
||
func main() { | ||
cfg := config{} | ||
err := plugin.ParseConfig(&cfg) | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "failed to load config: %s", err) | ||
os.Exit(1) | ||
} | ||
err = run(cfg) | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, err.Error()) | ||
os.Exit(1) | ||
} | ||
} |