From dca79db634a8a44c1688b0873cd0ab08ada29bd2 Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Wed, 5 Mar 2025 09:03:44 +0100 Subject: [PATCH 1/7] chore(deps): added dependabot config for actions --- .github/dependabot.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/dependabot.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..be80455 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + groups: + actions: + patterns: + - "*" From 86ace1fd9392149566c2ec73c590fb5a58a1a0b4 Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Wed, 5 Mar 2025 09:14:59 +0100 Subject: [PATCH 2/7] chore(docs): remove Travis CI configuration and update README for GitHub Actions --- .travis.yml | 7 ------- README.md | 8 +++++--- 2 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 78df272..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -go: - - 1.13 - - 1.14 - - tip -scripts: - - go test diff --git a/README.md b/README.md index 01de9cf..d212a89 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # envsubst +![GoVersion][goversion-url] [![GoDoc][godoc-img]][godoc-url] [![License][license-image]][license-url] -[![Build status][travis-image]][travis-url] +[![Build status][gha-image]][gha-url] [![Github All Releases][releases-image]][releases] > Environment variables substitution for Go. see docs [below](#docs) @@ -103,5 +104,6 @@ MIT [godoc-img]: https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge [license-url]: LICENSE -[travis-image]: https://img.shields.io/travis/a8m/envsubst.svg?style=for-the-badge -[travis-url]: https://travis-ci.org/a8m/envsubst +[gha-image]: https://img.shields.io/github/actions/workflow/status/a8m/envsubst/binaries.yml?style=for-the-badge +[gha-url]: https://github.com/a8m/envsubst/actions/workflows/binaries.yml +[goversion-url]: https://img.shields.io/github/go-mod/go-version/a8m/envsubst?style=for-the-badge From 3f10dd276a4f828fd672300664ed07ce15f0582f Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Wed, 5 Mar 2025 09:21:20 +0100 Subject: [PATCH 3/7] chore(ci): update Test workflow to use latest actions and improve formatting --- .github/workflows/test.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index daae817..b53b9a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,16 +7,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.23', '1.24' ] + go: + - 1.23 + - 1.24 name: Go ${{ matrix.go }} testing steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache: false - - name: Test - run: go test + - name: Test + run: go test From 1775cc25bba7d25d5bf0c9145a2a4a9eda0dc1f9 Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Wed, 5 Mar 2025 09:22:19 +0100 Subject: [PATCH 4/7] chore(ci): migrate to GoReleaser for releases and update workflow --- .github/workflows/binaries.yml | 85 ++++++++-------------------------- .gitignore | 2 + .goreleaser.yaml | 70 ++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 65 deletions(-) create mode 100644 .gitignore create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 0880691..b414e6b 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -1,4 +1,4 @@ -name: Release Binaries +name: Release on: release: @@ -9,69 +9,24 @@ permissions: packages: write jobs: - release-linux-amd64: - name: release linux/amd64 + goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.53 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: linux - goarch: amd64 - project_path: cmd/envsubst - asset_name: envsubst-Linux-x86_64 - compress_assets: OFF - release-linux-arm64: - name: release linux/arm64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.53 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: linux - goarch: arm64 - project_path: cmd/envsubst - asset_name: envsubst-Linux-arm64 - compress_assets: OFF - release-darwin-amd64: - name: release darwin/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.53 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: darwin - goarch: amd64 - project_path: cmd/envsubst - asset_name: envsubst-Darwin-x86_64 - compress_assets: OFF - release-darwin-arm64: - name: release darwin/arm64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.53 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: darwin - goarch: arm64 - project_path: cmd/envsubst - asset_name: envsubst-Darwin-arm64 - compress_assets: OFF - release-windows: - name: release windows - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: wangyoucao577/go-release-action@v1.53 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - goos: windows - goarch: amd64 - project_path: cmd/envsubst - binary_name: envsubst-windows #release fails if the binary name is the same as the asset name - asset_name: envsubst - compress_assets: OFF + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: false + + - uses: ko-build/setup-ko@v0.8 + + - uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..69dcb52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Added by goreleaser init: +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..1c8cab4 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,70 @@ +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - main: ./cmd/envsubst + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + - arm + - ppc64le + - s390x + goarm: + - "7" + flags: + - -trimpath + ldflags: + - -s -w + +archives: + - formats: binary + # This name template makes the OS and Arch compatible with the results of `uname`. + # Binaries for Windows amd64 are named envsubst.exe as fallback with previous versions. + name_template: >- + {{- if and (eq .Os "windows") (eq .Arch "amd64") -}} + {{- .ProjectName }} + {{- else -}} + {{- .ProjectName }}_{{ title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + {{- end -}} + +kos: + - base_image: gcr.io/distroless/static:nonroot + bare: true + preserve_import_paths: false + labels: + org.opencontainers.image.created: "{{ .Date }}" + org.opencontainers.image.revision: "{{ .ShortCommit }}" + org.opencontainers.image.source: "{{ .GitURL }}" + org.opencontainers.image.version: "{{ .Version }}" + platforms: + - all + repositories: + - "{{ .Env.KO_DOCKER_REPO }}" + tags: + - latest + - "{{ .Version }}" + +changelog: + use: github + +release: + mode: keep-existing From 0b783fcf8233ff8869503d92a2c87ad73814870e Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Fri, 7 Nov 2025 21:47:07 +0100 Subject: [PATCH 5/7] Pin versions to sha --- .github/workflows/binaries.yml | 8 ++++---- .github/workflows/test.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index b414e6b..30a0920 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -12,18 +12,18 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: go-version-file: go.mod cache: false - - uses: ko-build/setup-ko@v0.8 + - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - - uses: goreleaser/goreleaser-action@v6 + - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser version: "~> v2" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b53b9a1..739431b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,9 @@ jobs: name: Go ${{ matrix.go }} testing steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 with: go-version: ${{ matrix.go }} cache: false From 524a20ee4301de8a27578e4a12d7ddb49c565362 Mon Sep 17 00:00:00 2001 From: Dmytro Bondar Date: Fri, 7 Nov 2025 21:49:44 +0100 Subject: [PATCH 6/7] Change go version for tests from 1.23 to 1.25 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 739431b..6d5966f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: go: - - 1.23 + - 1.25 - 1.24 name: Go ${{ matrix.go }} testing From e3cb14ff62f5422ac6469a625b9ff3451c4d4832 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:38:07 +0100 Subject: [PATCH 7/7] build(deps): bump the actions group with 2 updates (#1) Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/checkout` from 5.0.0 to 6.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/08c6903cd8c0fde910a37f88322edcfb5dd907a8...1af3b93b6815bc44a9784bd300feb67ff0d1eeb3) Updates `actions/setup-go` from 6.0.0 to 6.1.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/44694675825211faa026b3c33043df3e48a5fa00...4dc6199c7b1a012772edbd06daecab0f50c9053c) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/setup-go dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/binaries.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index 30a0920..f485c50 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -12,11 +12,11 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 0 - - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 + - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 with: go-version-file: go.mod cache: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d5966f..09946c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,9 +13,9 @@ jobs: name: Go ${{ matrix.go }} testing steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 + - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 with: go-version: ${{ matrix.go }} cache: false