Skip to content

Commit e2f890a

Browse files
committed
PUBLISH!?
Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent d0f37d9 commit e2f890a

File tree

8 files changed

+139
-1
lines changed

8 files changed

+139
-1
lines changed

.github/workflows/changelog-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: CHANGELOG Unreleased Section
23

34
"on":
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
16+
steps:
17+
- uses: amannn/action-semantic-pull-request@v6
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/prevent-file-change.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
name: Prevent file change
3+
34
on:
45
pull_request_target:
56
branches: [main]

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: release-please
3+
4+
"on":
5+
push:
6+
tags: ["v*.*.*"]
7+
branches: [main]
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
attestations: write
13+
id-token: write
14+
15+
jobs:
16+
release-please:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
release_created: ${{ steps.release.outputs.release_created }}
20+
tag_name: ${{ steps.release.outputs.tag_name }}
21+
upload_url: ${{ steps.release.outputs.upload_url }}
22+
steps:
23+
- uses: googleapis/release-please-action@v4
24+
id: release
25+
with:
26+
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
27+
28+
- name: Checkout
29+
uses: actions/checkout@v5
30+
if: ${{ steps.release.outputs.release_created }}
31+
32+
- name: Create package archives
33+
if: ${{ steps.release.outputs.release_created }}
34+
run: |
35+
# Create temporary directory for packaging
36+
mkdir -p /tmp/package
37+
38+
# Copy all files except documentation directory
39+
rsync -av --exclude='documentation/' --exclude='.git/' . /tmp/package/
40+
41+
# Create tar.gz archive
42+
cd /tmp
43+
tar -czf haproxy-cookbook-${{ steps.release.outputs.tag_name }}.tar.gz package/
44+
45+
# Create zip archive
46+
zip -r haproxy-cookbook-${{ steps.release.outputs.tag_name }}.zip package/
47+
48+
# Move archives to workspace
49+
mv haproxy-cookbook-${{ steps.release.outputs.tag_name }}.tar.gz ${{ github.workspace }}/
50+
mv haproxy-cookbook-${{ steps.release.outputs.tag_name }}.zip ${{ github.workspace }}/
51+
52+
- name: Generate artifact attestation
53+
if: ${{ steps.release.outputs.release_created }}
54+
uses: actions/attest-build-provenance@v1
55+
with:
56+
subject-path: |
57+
haproxy-cookbook-${{ steps.release.outputs.tag_name }}.tar.gz
58+
haproxy-cookbook-${{ steps.release.outputs.tag_name }}.zip
59+
60+
- name: Upload archives to release
61+
if: ${{ steps.release.outputs.release_created }}
62+
uses: actions/upload-release-asset@v1
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
with:
66+
upload_url: ${{ steps.release.outputs.upload_url }}
67+
asset_path: ./haproxy-cookbook-${{ steps.release.outputs.tag_name }}.tar.gz
68+
asset_name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}.tar.gz
69+
asset_content_type: application/gzip
70+
71+
- name: Upload zip to release
72+
if: ${{ steps.release.outputs.release_created }}
73+
uses: actions/upload-release-asset@v1
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
with:
77+
upload_url: ${{ steps.release.outputs.upload_url }}
78+
asset_path: ./haproxy-cookbook-${{ steps.release.outputs.tag_name }}.zip
79+
asset_name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}.zip
80+
asset_content_type: application/zip
81+
82+
publish-to-supermarket:
83+
needs: release-please
84+
if: ${{ needs.release-please.outputs.release_created }}
85+
runs-on: ubuntu-latest
86+
container:
87+
image: chef/chefworkstation:latest
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v5
91+
92+
- name: Configure Chef credentials
93+
run: |
94+
mkdir -p ~/.chef
95+
echo "${{ secrets.CHEF_SUPERMARKET_KEY }}" > ~/.chef/supermarket.pem
96+
chmod 600 ~/.chef/supermarket.pem
97+
98+
- name: Publish to Chef Supermarket
99+
run: |
100+
knife supermarket share haproxy \
101+
--supermarket-site https://supermarket.chef.io \
102+
--key ~/.chef/supermarket.pem \
103+
--user-name ${{ secrets.CHEF_SUPERMARKET_USER }}

metadata.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
require_relative 'version'
2+
13
name 'haproxy'
24
maintainer 'Sous Chefs'
35
maintainer_email 'help@sous-chefs.org'
46
license 'Apache-2.0'
57
description 'Installs and configures haproxy'
6-
version '12.4.1'
8+
version VERSION
79
source_url 'https://github.com/sous-chefs/haproxy'
810
issues_url 'https://github.com/sous-chefs/haproxy/issues'
911
chef_version '>= 16'

release-please-config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"releaseType": "ruby",
3+
"changelogPath": "CHANGELOG.md",
4+
"versionFile": "version.rb",
5+
"includeComponentInTag": false
6+
}

release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "12.4.1"
3+
}

version.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# frozen_string_literal: true
2+
3+
VERSION = '12.4.1'

0 commit comments

Comments
 (0)