-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (77 loc) · 2.66 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: build
on:
push:
branches:
- main
- maint/*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
DRY_RUN: ${{ github.ref_name != github.event.repository.default_branch && !startsWith(github.ref_name, 'maint/') }}
OWNER: ${{ github.repository_owner }}
HUSKY: 0
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: corepack enable
- run: pnpm install
- run: pnpm prettier
build:
needs:
- lint
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
- name: Docker registry login
if: env.DRY_RUN == 'false'
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ env.OWNER }} --password-stdin
- name: Publish to docker.io
uses: containerbase/internal-tools@72750e92d57f4ec2412af2f4f63f57eafa626bb4 # v3.4.42
with:
command: docker-builder
image-prefix: ${{ env.OWNER }}
platforms: linux/amd64,linux/arm64
last-only: true
major-minor: false
dry-run: ${{ env.DRY_RUN }}
- name: Publish to ghcr.io
uses: containerbase/internal-tools@72750e92d57f4ec2412af2f4f63f57eafa626bb4 # v3.4.42
with:
command: docker-builder
image-prefix: ghcr.io/${{ env.OWNER }}
platforms: linux/amd64,linux/arm64
last-only: true
major-minor: false
dry-run: ${{ env.DRY_RUN }}
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Init
run: ./bin/init.sh
- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
if: env.DRY_RUN == 'false'
with:
allowUpdates: true
body: See https://github.com/containerbase/base/releases/tag/${{ env.VERSION }} for more changes
commit: ${{ github.sha }}
name: ${{ env.VERSION }}
tag: v${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}