-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: switch to goreleaser * config * add docker config * clean dockerfil * clean dockerfile * remove docker * cleanup
- Loading branch information
Showing
10 changed files
with
115 additions
and
131 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
on: | ||
push: | ||
tags: [v*.*.*] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- run: echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
|
||
- run: docker build -t ghcr.io/${GITHUB_REPOSITORY}:${IMAGE_TAG} . | ||
|
||
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- run: docker push ghcr.io/${GITHUB_REPOSITORY}:${IMAGE_TAG} | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- uses: goreleaser/[email protected] | ||
with: | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,15 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- uses: golangci/golangci-lint-action@v2 | ||
|
||
- run: docker build -t test . |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -19,4 +19,5 @@ test.sh | |
load.py | ||
state.db | ||
discord-stock-ticker | ||
test.state | ||
test.state | ||
dist/ |
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,55 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- ldflags: | ||
- -X 'main.buildVersion={{.Version}}' | ||
env: | ||
- CGO_ENABLED=0 | ||
# https://pkg.go.dev/modernc.org/sqlite#hdr-Supported_platforms_and_architectures | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
- freebsd | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
- 386 | ||
ignore: | ||
- goos: darwin | ||
goarch: arm | ||
- goos: darwin | ||
goarch: 386 | ||
- goos: freebsd | ||
goarch: arm64 | ||
- goos: freebsd | ||
goarch: arm | ||
- goos: freebsd | ||
goarch: 386 | ||
- goos: windows | ||
goarch: arm64 | ||
- goos: windows | ||
goarch: arm | ||
- goos: windows | ||
goarch: 386 | ||
archives: | ||
- replacements: | ||
386: i386 | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
# dockers: | ||
# - image_templates: | ||
# - "gcr.io/rssnyder/discord-stock-ticker:latest" | ||
# - "gcr.io/rssnyder/discord-stock-ticker:{{ .Tag }}" | ||
# build_flag_templates: | ||
# - "--label=org.opencontainers.image.created={{.Date}}" | ||
# - "--label=org.opencontainers.image.title={{.ProjectName}}" | ||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
# - "--label=org.opencontainers.image.version={{.Version}}" | ||
# - "--label=org.opencontainers.image.source={{.GitURL}}" |
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 |
---|---|---|
@@ -1,19 +1,13 @@ | ||
FROM golang:latest AS base | ||
LABEL org.opencontainers.image.source https://github.com/rssnyder/discord-stock-ticker | ||
|
||
RUN apt-get update && \ | ||
apt-get -y --no-install-recommends install software-properties-common && \ | ||
add-apt-repository "deb http://httpredir.debian.org/debian bullseye main" && \ | ||
apt-get update && \ | ||
apt-get -qq install -y libvips-dev && rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /go/src/app | ||
WORKDIR /go/src/discord-stock-ticker | ||
|
||
COPY . . | ||
|
||
ARG TARGETOS=linux | ||
ARG TARGETARCH=amd64 | ||
|
||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=1 go build -o /bin/ticker | ||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o discord-stock-ticker | ||
|
||
ENTRYPOINT ["/bin/ticker"] | ||
ENTRYPOINT ["/go/src/discord-stock-ticker/discord-stock-ticker"] |
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
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
6859ab1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
200