Skip to content

Commit 41fe05b

Browse files
committed
Merge branch 'pullrequests/tarampampam/master'
# Conflicts: # .github/workflows/release.yml
2 parents 97fa9fd + a7f1272 commit 41fe05b

File tree

26 files changed

+1194
-585
lines changed

26 files changed

+1194
-585
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
name: Docker Hub Description
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

18-
- uses: peter-evans/dockerhub-description@v4
18+
- uses: peter-evans/dockerhub-description@v5
1919
with:
2020
username: ${{ secrets.DOCKER_LOGIN }}
2121
password: ${{ secrets.DOCKER_USER_PASSWORD }}

.github/workflows/release.yml

Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,79 @@ on:
88
types: [published]
99

1010
jobs:
11-
# build:
12-
# name: Build for ${{ matrix.os }} (${{ matrix.arch }})
13-
# runs-on: ubuntu-latest
14-
# strategy:
15-
# fail-fast: false
16-
# matrix:
17-
# os: [linux, darwin, windows] # freebsd
18-
# arch: [amd64, arm64] # 386
19-
# steps:
20-
# - uses: actions/checkout@v4
21-
# - {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
22-
# - {uses: gacts/github-slug@v1, id: slug}
23-
# - id: values
24-
# run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT
25-
# - env:
26-
# GOOS: ${{ matrix.os }}
27-
# GOARCH: ${{ matrix.arch }}
28-
# CGO_ENABLED: 0
29-
# LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }}
30-
# run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/
31-
# - uses: svenstaro/upload-release-action@v2
32-
# with:
33-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
34-
# file: ${{ steps.values.outputs.binary-name }}
35-
# asset_name: ${{ steps.values.outputs.binary-name }}
36-
# tag: ${{ github.ref }}
11+
build:
12+
name: Build for ${{ matrix.os }} (${{ matrix.arch }})
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [linux, darwin, windows] # freebsd
18+
arch: [amd64, arm64] # 386
19+
steps:
20+
- uses: actions/checkout@v5
21+
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
22+
- {uses: gacts/github-slug@v1, id: slug}
23+
- id: values
24+
run: echo "binary-name=error-pages-${{ matrix.os }}-${{ matrix.arch }}`[ ${{ matrix.os }} = 'windows' ] && echo '.exe'`" >> $GITHUB_OUTPUT
25+
- env:
26+
GOOS: ${{ matrix.os }}
27+
GOARCH: ${{ matrix.arch }}
28+
CGO_ENABLED: 0
29+
LDFLAGS: -s -w -X gh.tarampamp.am/error-pages/internal/version.version=${{ steps.slug.outputs.version }}
30+
run: go build -trimpath -ldflags "$LDFLAGS" -o "./${{ steps.values.outputs.binary-name }}" ./cmd/error-pages/
31+
- uses: svenstaro/upload-release-action@v2
32+
with:
33+
repo_token: ${{ secrets.GITHUB_TOKEN }}
34+
file: ${{ steps.values.outputs.binary-name }}
35+
asset_name: ${{ steps.values.outputs.binary-name }}
36+
tag: ${{ github.ref }}
3737

38-
# - if: matrix.os == 'linux' && matrix.arch == 'amd64'
39-
# run: mkdir ./out && ./${{ steps.values.outputs.binary-name }} build --index --disable-minification --target-dir ./out
40-
# - if: matrix.os == 'linux' && matrix.arch == 'amd64'
41-
# uses: actions/upload-artifact@v4
42-
# with:
43-
# name: error-pages-static
44-
# path: out/
45-
# if-no-files-found: error
46-
# retention-days: 1
47-
# - if: matrix.os == 'linux' && matrix.arch == 'amd64'
48-
# working-directory: ./out
49-
# run: zip -r ./../templates.zip .
50-
# - if: matrix.os == 'linux' && matrix.arch == 'amd64'
51-
# uses: svenstaro/upload-release-action@v2
52-
# with:
53-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
54-
# file: templates.zip
55-
# asset_name: error-pages-static.zip
56-
# tag: ${{ github.ref }}
38+
- if: matrix.os == 'linux' && matrix.arch == 'amd64'
39+
run: mkdir ./out && ./${{ steps.values.outputs.binary-name }} build --index --disable-minification --target-dir ./out
40+
- if: matrix.os == 'linux' && matrix.arch == 'amd64'
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: error-pages-static
44+
path: out/
45+
if-no-files-found: error
46+
retention-days: 1
47+
- if: matrix.os == 'linux' && matrix.arch == 'amd64'
48+
working-directory: ./out
49+
run: zip -r ./../templates.zip .
50+
- if: matrix.os == 'linux' && matrix.arch == 'amd64'
51+
uses: svenstaro/upload-release-action@v2
52+
with:
53+
repo_token: ${{ secrets.GITHUB_TOKEN }}
54+
file: templates.zip
55+
asset_name: error-pages-static.zip
56+
tag: ${{ github.ref }}
5757

58-
# demo:
59-
# name: Update the demo (GitHub Pages)
60-
# runs-on: ubuntu-latest
61-
# needs: [build]
62-
# steps:
63-
# - uses: actions/download-artifact@v4
64-
# with:
65-
# name: error-pages-static
66-
# path: .artifact
67-
# - uses: peaceiris/actions-gh-pages@v4
68-
# with:
69-
# github_token: ${{ secrets.GITHUB_TOKEN }}
70-
# publish_dir: ./.artifact
58+
demo:
59+
name: Update the demo (GitHub Pages)
60+
runs-on: ubuntu-latest
61+
needs: [build]
62+
steps:
63+
- uses: actions/download-artifact@v5
64+
with:
65+
name: error-pages-static
66+
path: .artifact
67+
- uses: peaceiris/actions-gh-pages@v4
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: ./.artifact
7171

7272
docker-image:
7373
name: Build the docker image
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v4
76+
- uses: actions/checkout@v5
7777
- {uses: gacts/github-slug@v1, id: slug}
7878
- uses: docker/setup-qemu-action@v3
7979
- uses: docker/setup-buildx-action@v3
80+
- uses: docker/login-action@v3
81+
with:
82+
username: ${{ secrets.DOCKER_LOGIN }}
83+
password: ${{ secrets.DOCKER_PASSWORD }}
8084
- uses: docker/login-action@v3
8185
with:
8286
registry: ghcr.io
@@ -90,7 +94,11 @@ jobs:
9094
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
9195
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}"
9296
tags: |
93-
ghcr.io/${{ github.repository }}:latest
94-
ghcr.io/${{ github.repository }}:${{ steps.slug.outputs.version }}
95-
ghcr.io/${{ github.repository }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
96-
ghcr.io/${{ github.repository }}:${{ steps.slug.outputs.version-major }}
97+
tarampampam/error-pages:latest
98+
tarampampam/error-pages:${{ steps.slug.outputs.version }}
99+
tarampampam/error-pages:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
100+
tarampampam/error-pages:${{ steps.slug.outputs.version-major }}
101+
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:latest
102+
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version }}
103+
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}.${{ steps.slug.outputs.version-minor }}
104+
ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}:${{ steps.slug.outputs.version-major }}

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
name: Run golangci-lint
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3131
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
32-
- uses: golangci/golangci-lint-action@v6
32+
- uses: golangci/golangci-lint-action@v8
3333

3434
go-test:
3535
name: Unit tests
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v5
3939
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
4040
- run: go test -race ./...
4141

@@ -49,7 +49,7 @@ jobs:
4949
arch: [amd64, arm64] # 386
5050
needs: [golangci-lint, go-test]
5151
steps:
52-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@v5
5353
- {uses: actions/setup-go@v5, with: {go-version-file: go.mod}}
5454
- {uses: gacts/github-slug@v1, id: slug}
5555
- env:
@@ -81,7 +81,7 @@ jobs:
8181
runs-on: ubuntu-latest
8282
needs: [golangci-lint, go-test]
8383
steps:
84-
- uses: actions/checkout@v4
84+
- uses: actions/checkout@v5
8585
- {uses: gacts/github-slug@v1, id: slug}
8686
- uses: docker/build-push-action@v6
8787
with:

0 commit comments

Comments
 (0)