Skip to content

Commit

Permalink
Update to Go 1.23 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome authored Nov 5, 2024
1 parent 863001a commit d79082f
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 35 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

- package-ecosystem: gomod
directory: /
schedule:
interval: weekly

- package-ecosystem: docker
directory: /
schedule:
interval: weekly
16 changes: 7 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Checkout Repository
uses: actions/checkout@v4

- uses: actions/checkout@v2
- name: Setup Golang Environment
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Build
run: |
go get -d -v
go build -v .
run: go build -v .
6 changes: 5 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4

- name: Update action.yml to build locally
run: |
sed -i 's/.*image\:.*/ image\: \"Dockerfile\"/' action.yml
cat action.yml
- name: Self test
id: selftest
uses: ./
with:
include: "test/**"
find: "world"
replace: "there"

- name: Check outputs and modified files
run: |
test "${{ steps.selftest.outputs.modifiedFiles }}" == "1"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4

- name: Get release version
id: get_version
run: echo ::set-env name=RELEASE_VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Checkout Repository
uses: actions/checkout@v4

- uses: actions/checkout@v2
- name: Setup Golang Environment
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Test
run: |
go get -d -v
go test
run: go test -race -shuffle=on -v ./...
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM golang:1.13 as builder
FROM golang:1.23 AS builder

WORKDIR /app
COPY . /app

RUN go get -d -v

# Statically compile our app for use in a distroless container
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -v -o app .

Expand All @@ -14,4 +12,4 @@ FROM gcr.io/distroless/static

COPY --from=builder /app/app /app

ENTRYPOINT ["/app"]
ENTRYPOINT ["/app"]
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
Expand All @@ -79,7 +81,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
Expand All @@ -99,7 +103,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
Expand All @@ -117,7 +123,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
Expand All @@ -139,13 +147,16 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "hello"
replace: "world"
regex: false
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@v4
```
Expand All @@ -162,17 +173,16 @@ _If you need the push event to trigger other workflows, use a `repo` scoped [Per

## Contributing

Install [go](https://go.dev/doc/install). This project currently uses Go 1.13. We recommend [gvm](https://github.com/moovweb/gvm) to switch between multiple go versions.
Install [go](https://go.dev/doc/install). This project currently uses Go 1.23. We recommend [gvm](https://github.com/moovweb/gvm) to switch between multiple go versions.

```
```shell
$ go version
go version go1.13 darwin/amd64
go version go1.23.2 darwin/amd64
```

Build and test.

```
go get -d -v
```shell
go test
go build -v .
```
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/jacobtomlinson/gha-find-replace

go 1.23.2

require github.com/gobwas/glob v0.2.3
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=

0 comments on commit d79082f

Please sign in to comment.