diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8770454..4035176 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,38 @@ permissions: contents: read jobs: + get-versions: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.versions.outputs.matrix }} + latest: ${{ steps.latest.outputs.version }} + steps: + - name: Get Go versions + id: versions + run: | + VERSIONS=$( + curl -s 'https://go.dev/dl/?mode=json' \ + | jq -r ' + [.[] | select(.stable) | .version] + | group_by(split(".")[0:2] | join(".")) + | map(max_by(ltrimstr("go") | split(".") | map(tonumber)))[] + ' | sed 's/go//' + ) + VERSIONS_ARRAY=$(echo "$VERSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "matrix={\"go-version\":$VERSIONS_ARRAY}" >> $GITHUB_OUTPUT + + - name: Get latest version + id: latest + run: | + matrix='${{ steps.versions.outputs.matrix }}' + latest=$(echo "$matrix" | jq -r '.["go-version"][-1]') + echo "version=$latest" >> $GITHUB_OUTPUT + build-and-push: + needs: get-versions runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJson(needs.get-versions.outputs.matrix) }} steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -34,16 +64,24 @@ jobs: id: date run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + - name: Set tags + id: tags + run: | + tags="esacteksab/go:${{ matrix.go-version }}\nesacteksab/go:${{ matrix.go-version }}-${{ steps.date.outputs.date }}" + if [ "${{ matrix.go-version }}" = "${{ needs.get-versions.outputs.latest }}" ]; then + tags="${tags}\nesacteksab/go:latest" + fi + echo "tags<> $GITHUB_OUTPUT + echo -e "$tags" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Build and push Docker image uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #v6.18.0 with: context: . push: true - tags: | - esacteksab/go:latest - esacteksab/go:${{ vars.GO_VERSION }} - esacteksab/go:${{ vars.GO_VERSION }}-${{ steps.date.outputs.date }} + tags: ${{ steps.tags.outputs.tags }} build-args: | - GO_VERSION=${{ vars.GO_VERSION }} + GO_VERSION=${{ matrix.go-version }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.gitignore b/.gitignore index 53463e3..b315e54 100644 --- a/.gitignore +++ b/.gitignore @@ -227,3 +227,5 @@ terraform.rc !.vscode/settings.json # Stores VSCode versions used for testing VSCode extensions .vscode-test + +foo.sh diff --git a/.mise.toml b/.mise.toml index a17bd29..789462e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -9,8 +9,8 @@ path = ".venv" [tools] - golang = "1.25.7" - nodejs = "22.15.1" - pnpm = "10.24.0" + golang = "1.25.8" + nodejs = "22.22.1" + pnpm = "10.32.0" python = "3.12.10" uv = "latest" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b236605..ee2d5bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,13 +29,13 @@ repos: name: "Git Leaks" - repo: https://github.com/google/keep-sorted - rev: v0.7.1 + rev: v0.8.0 hooks: - id: keep-sorted name: "Keep Sorted" - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.35.0 + rev: 0.37.0 hooks: - id: check-github-workflows - id: check-dependabot @@ -90,7 +90,7 @@ repos: - mdformat-footnote - repo: https://github.com/crate-ci/typos - rev: v1.40.0 + rev: v1.44.0 hooks: - id: typos args: [--force-exclude] @@ -103,7 +103,7 @@ repos: name: "Shell Check" - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.19.1 + rev: v0.21.0 hooks: - id: markdownlint-cli2 name: "Markdown Lint" diff --git a/Dockerfile b/Dockerfile index 29fc5f3..4d8b285 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:24.04@sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b AS base -ARG GO_VERSION=1.25.7 +ARG GO_VERSION=1.25.8 # Install dependencies, download Go, and set it up in one layer RUN set -eux && \ diff --git a/README.md b/README.md index e97b8fd..57331d9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A lightweight Docker container for Go development based on Ubuntu 24.04. ```bash -esacteksab/go 3d6df1c54b86 3 hours ago 335MB +esacteksab/go 1.25.8 f1f694493a08 2 minutes ago 445MB golang 1.24.3-bookworm f254902cf370 2 days ago 853MB ``` @@ -14,15 +14,15 @@ This repository contains a Dockerfile and GitHub Actions workflow that creates a ## Container Details - **Base Image:** Ubuntu 24.04 -- **Go Version:** Configurable via repository variables `GO_VERSION=1.25.6` +- **Go Version:** Configurable via repository variables `GO_VERSION=1.25.8` - **Registry:** [Docker Hub - esacteksab/go](https://hub.docker.com/r/esacteksab/go) - **Build Schedule:** Every Friday at 9:00 AM Central Time (US/Chicago) ## Available Tags - `latest` - The most recent build -- `1.25.6` (or current Go version) - Tagged with the specific Go version -- `1.25.6-YYYY-MM-DD` - Version with build date for historical reference +- `1.25.8` (or current Go version) - Tagged with the specific Go version +- `1.25.8-YYYY-MM-DD` - Version with build date for historical reference ## Features diff --git a/package.json b/package.json index 7c7bd6e..aa79829 100644 --- a/package.json +++ b/package.json @@ -6,5 +6,5 @@ "prettier-plugin-sh": "^0.18.0", "prettier-plugin-toml": "^2.0.6" }, - "packageManager": "pnpm@10.24.0" + "packageManager": "pnpm@10.32.0" }