Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ci updates #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -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:
- "*"
85 changes: 20 additions & 65 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Binaries
name: Release

on:
release:
Expand All @@ -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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]
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/[email protected]

- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 10 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Added by goreleaser init:
dist/
70 changes: 70 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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