11 Commits

Author SHA1 Message Date
7431eb94f1 Move to public repo
All checks were successful
Build and Publish / build (push) Successful in 46s
Build and Publish / publish (push) Successful in 5s
2024-12-17 16:02:58 -05:00
ae094a566c Add go package upload
All checks were successful
Build and Publish / build (push) Successful in 41s
Build and Publish / publish (push) Successful in 5s
2024-12-16 16:51:09 -05:00
77ceb1fc1b Add go package upload 2024-12-16 16:49:10 -05:00
09e5cdd201 Add go package upload 2024-12-16 16:48:11 -05:00
bccd91ca30 Add go package upload 2024-12-16 16:46:19 -05:00
80570fec7c Add go package upload 2024-12-16 16:40:46 -05:00
3031f52411 Add go package upload 2024-12-16 16:32:35 -05:00
a69963dbf3 Add go package upload 2024-12-16 16:28:20 -05:00
b01c73fab1 Add go package upload 2024-12-16 16:26:11 -05:00
22cb6ca030 Add go package upload 2024-12-16 16:23:24 -05:00
954045cd09 Add go package upload 2024-12-16 16:21:11 -05:00
16 changed files with 36 additions and 30 deletions

View File

@ -7,11 +7,8 @@ env:
PACKAGE_NAME: eia-api-go
BINARY_PATH: bin
BINARY_NAME: eia-client
GO_MOD_PATH: gitea.libretechconsulting.com/50w/eia-api-go
GOPRIVATE: gitea.libretechconsulting.com/*
# DOCKER_HOST: "unix:///var/run/user/1000/docker.sock"
# DOCKER_ORG: "rmcguire"
# DOCKER_LATEST: "latest"
GO_MOD_PATH: gitea.libretechconsulting.com/rmcguire/eia-api-go
GO_GIT_HOST: gitea.libretechconsulting.com
jobs:
build:
@ -32,6 +29,7 @@ jobs:
env:
API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
run: |
echo "Pushing ./$BINARY_PATH/$BINARY_NAME to ${GITHUB_SERVER_URL} packages for ${GITHUB_REPOSITORY_OWNER} as ${PACKAGE_NAME}@${{ github.ref_name }}"
if [ -f ./${BINARY_PATH}/${BINARY_NAME} ]; then
curl -X PUT \
-H "Authorization: token ${API_TOKEN}" \
@ -43,15 +41,23 @@ jobs:
fi
- name: Generate and Upload Package to Go Registry
env:
GOPRIVATE: gitea.libretechconsulting.com/*
API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
run: |
echo "Generating package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
go mod tidy -v
go mod download --json ${GO_MOD_PATH}@${{ github.ref_name }} > package.json
# Set up netrc for Gitea
echo "machine ${GO_GIT_HOST} login ${GITHUB_REPOSITORY_OWNER} password ${API_TOKEN}" > ~/.netrc
chmod 0600 ~/.netrc
# Package and get mod info
go mod download -x --json ${GO_MOD_PATH}@${{ github.ref_name }} | tee package.json
if [[ $? -ne 0 ]]; then
echo "Failed to generage go package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
exit 1
fi
ZIPFILE=$( jq .Zip < package.json )
ZIPFILE=$( jq .Zip < package.json | tr -d '"' )
# Upload to Gitea go registry
echo "Uploading go package ${ZIPFILE}"
curl -X PUT \
-H "Authorization: token ${API_TOKEN}" \

View File

@ -281,7 +281,7 @@ If you develop a new program, and you want it to be of the greatest possible use
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
eia-api-go
Copyright (C) 2024 50W
Copyright (C) 2024 Ryan D. McGuire
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
@ -293,7 +293,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
eia-api-go Copyright (C) 2024 50W
eia-api-go Copyright (C) 2024 Ryan D. McGuire
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.

View File

@ -6,7 +6,7 @@ import (
"github.com/goccy/go-yaml"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/internal/util"
)
var GetFacetsCmd = &cobra.Command{

View File

@ -8,8 +8,8 @@ import (
"github.com/goccy/go-yaml"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/pkg/eia"
)
var (

View File

@ -4,7 +4,7 @@ import (
"github.com/k0kubun/pp/v3"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/internal/util"
)
var listFacetsCmd = &cobra.Command{

View File

@ -6,8 +6,8 @@ import (
"github.com/k0kubun/pp/v3"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/pkg/eia"
)
var listRoutesCmd = &cobra.Command{

View File

@ -31,9 +31,9 @@ import (
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/cmd/get"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/cmd/list"
"gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/internal/util"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/cmd/get"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/cmd/list"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/internal/util"
)
// rootCmd represents the base command when called without any subcommands

View File

@ -9,7 +9,7 @@ import (
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/pkg/eia"
)
var (

View File

@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/pkg/eia"
)
// Given args of <route> <facet>, complete either the route arg or the

View File

@ -3,8 +3,8 @@ package util
import (
"github.com/spf13/cobra"
eiaapi "gitea.libretechconsulting.com/50W/eia-api-go/api"
"gitea.libretechconsulting.com/50W/eia-api-go/pkg/eia"
eiaapi "gitea.libretechconsulting.com/rmcguire/eia-api-go/api"
"gitea.libretechconsulting.com/rmcguire/eia-api-go/pkg/eia"
)
func GetRouteType(cmd *cobra.Command, route string) (eia.RouteType, error) {

View File

@ -21,7 +21,7 @@ THE SOFTWARE.
*/
package main
import "gitea.libretechconsulting.com/50W/eia-api-go/cmd/eia-client/cmd"
import "gitea.libretechconsulting.com/rmcguire/eia-api-go/cmd/eia-client/cmd"
func main() {
cmd.Execute()

2
go.mod
View File

@ -1,4 +1,4 @@
module gitea.libretechconsulting.com/50W/eia-api-go
module gitea.libretechconsulting.com/rmcguire/eia-api-go
go 1.23.3

View File

@ -12,7 +12,7 @@ import (
"github.com/deepmap/oapi-codegen/pkg/securityprovider"
"github.com/rs/zerolog"
eiaapi "gitea.libretechconsulting.com/50W/eia-api-go/api"
eiaapi "gitea.libretechconsulting.com/rmcguire/eia-api-go/api"
)
const (

View File

@ -8,7 +8,7 @@ import (
"github.com/rs/zerolog"
eiaapi "gitea.libretechconsulting.com/50W/eia-api-go/api"
eiaapi "gitea.libretechconsulting.com/rmcguire/eia-api-go/api"
)
func newLoggingMiddleware(logger *zerolog.Logger, level zerolog.Level) eiaapi.RequestEditorFn {

View File

@ -11,7 +11,7 @@ import (
"strings"
"time"
eiaapi "gitea.libretechconsulting.com/50W/eia-api-go/api"
eiaapi "gitea.libretechconsulting.com/rmcguire/eia-api-go/api"
)
// For reflected API requests, dynamically replace certain

View File

@ -7,7 +7,7 @@ import (
"k8s.io/utils/ptr"
eiaapi "gitea.libretechconsulting.com/50W/eia-api-go/api"
eiaapi "gitea.libretechconsulting.com/rmcguire/eia-api-go/api"
)
func TestGetRoutes(t *testing.T) {