-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (100 loc) · 3.52 KB
/
build-go-binsize-treemap.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
################################################################################
# DO NOT EDIT THIS FILE!
#
# 1. Edit the *.gotmpl.yml files instead.
# 2. go run generate-workflow.go -t _download-and-package.gotmpl.yml -p go-binsize-treemap -r 'nikolaydubina/go-binsize-treemap' -c '10 6 * * *'
################################################################################
name: "📦 Build go-binsize-treemap"
on:
workflow_dispatch:
push:
branches: [main]
paths:
- ".github/workflows/build-go-binsize-treemap.yml"
- "packages/go-binsize-treemap/**"
pull_request:
branches: [main]
paths:
- ".github/workflows/build-go-binsize-treemap.yml"
- "packages/go-binsize-treemap/**"
schedule:
- cron: "10 6 * * *"
defaults:
run:
shell: bash
env:
DOCKER_BUILDKIT: 1
REGISTRY: ${{ vars.REGISTRY }}
permissions: read-all
jobs:
lookup:
runs-on: ubuntu-latest
name: Lookup current version
permissions:
packages: write
contents: read
strategy:
fail-fast: false
container:
image: ghcr.io/northwood-labs/package-builder/ubuntu-v22.04:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
outputs:
cache_hit: ${{ steps.check.outputs.cache-hit }}
package_version: ${{ steps.lookup_version.outputs.package_version }}
steps:
- name: Lookup latest version of package
id: lookup_version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "package_version=$(download-asset latest-tag -r 'nikolaydubina/go-binsize-treemap' -s)" >> $GITHUB_OUTPUT
- name: Check to see if we've already built this version
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
id: check
with:
key: "go-binsize-treemap-${{ steps.lookup_version.outputs.package_version }}"
path: "packages/go-binsize-treemap/dist"
lookup-only: true
build:
if: needs.lookup.outputs.cache_hit != 'true'
needs: lookup
name: "📦 Build and cache"
uses: northwood-labs/package-building/.github/workflows/_build-and-cache-go-build.yml@main
secrets: inherit
with:
package-name: "go-binsize-treemap"
package-version: ${{ needs.lookup.outputs.package_version }}
clone-repository: https://github.com/nikolaydubina/go-binsize-treemap
upload:
if: needs.lookup.outputs.cache_hit != 'true'
needs: build
name: Upload to S3
uses: northwood-labs/package-building/.github/workflows/upload-to-s3.yml@main
secrets: inherit
with:
package-name: "go-binsize-treemap"
package-version: ${{ needs.lookup.outputs.package_version }}
metadata_rpm:
if: needs.lookup.outputs.cache_hit != 'true'
needs: upload
name: RPM metadata
uses: northwood-labs/package-building/.github/workflows/generate-rpm-meta.yml@main
secrets: inherit
metadata_deb:
if: needs.lookup.outputs.cache_hit != 'true'
needs: upload
name: DEB metadata
uses: northwood-labs/package-building/.github/workflows/generate-deb-meta.yml@main
secrets: inherit
metadata_apk:
if: needs.lookup.outputs.cache_hit != 'true'
needs: upload
name: APK metadata
uses: northwood-labs/package-building/.github/workflows/generate-apk-meta.yml@main
secrets: inherit