-
-
Notifications
You must be signed in to change notification settings - Fork 242
fix: Fix tested platforms & Add publishing support #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6796313
fix: Update tested platforms
damacus b45fd3f
Add label workflow
damacus 3120b20
Prevent users from changing metadata.rb and any workflow
damacus 0baf589
Fix
damacus 24ea87e
YOLO BASH
damacus 347566f
Thanks Claude
damacus d0f37d9
Merge branch 'main' into platforms
damacus c2a0525
PUBLISH!?
damacus 16b6c64
Fix: Fix upload step
damacus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| name: CHANGELOG Unreleased Section | ||
|
|
||
| "on": | ||
| push: {branches: [main]} | ||
|
|
||
| jobs: | ||
| check-changelog: | ||
| runs-on: ubuntu-latest | ||
| name: Verify CHANGELOG.md has unreleased entries | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Extract and validate Unreleased section | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
|
|
||
| // Read CHANGELOG.md | ||
| const changelog = fs.readFileSync('CHANGELOG.md', 'utf8'); | ||
|
|
||
| // Split into lines | ||
| const lines = changelog.split('\n'); | ||
|
|
||
| // Find the "## Unreleased" section | ||
| const unreleasedIndex = lines.findIndex(line => line.trim() === '## Unreleased'); | ||
|
|
||
| if (unreleasedIndex === -1) { | ||
| core.setFailed('❌ ERROR: Could not find "## Unreleased" section in CHANGELOG.md'); | ||
| return; | ||
| } | ||
|
|
||
| // Find the next "## " section (next version) | ||
| const nextSectionIndex = lines.findIndex((line, index) => | ||
| index > unreleasedIndex && line.match(/^## \d+\.\d+\.\d+/) | ||
| ); | ||
|
|
||
| // Extract content between sections | ||
| const endIndex = nextSectionIndex === -1 ? lines.length : nextSectionIndex; | ||
| const unreleasedLines = lines.slice(unreleasedIndex + 1, endIndex); | ||
|
|
||
| // Filter out empty lines and whitespace-only lines | ||
| const contentLines = unreleasedLines.filter(line => | ||
| line.trim().length > 0 | ||
| ); | ||
|
|
||
| console.log('Extracted unreleased content:'); | ||
| contentLines.forEach(line => console.log(line)); | ||
| console.log('---'); | ||
|
|
||
| // Check if there's any actual content | ||
| if (contentLines.length === 0) { | ||
| core.setFailed('❌ ERROR: CHANGELOG.md "## Unreleased" section is empty or contains only blank lines\nPlease add at least one entry describing the changes in this release.'); | ||
| } else { | ||
| console.log(`✅ SUCCESS: CHANGELOG.md "## Unreleased" section contains entries`); | ||
| console.log(`Found ${contentLines.length} non-blank lines`); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: 'Lint PR' | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - edited | ||
| - reopened | ||
|
|
||
| jobs: | ||
| main: | ||
| name: Validate PR title | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@v6 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Pull Request Labels | ||
| on: | ||
| pull_request: | ||
| types: [opened, labeled, unlabeled, synchronize] | ||
| jobs: | ||
| label: | ||
| name: Require Release Label | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: mheap/github-action-required-labels@v5 | ||
| with: | ||
| mode: exactly | ||
| count: 1 | ||
| labels: | | ||
| Release: Major | ||
| Release: Minor | ||
| Release: Patch | ||
| Release: Skip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| name: Prevent file change | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| prevent-metadata-change: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read | ||
| steps: | ||
| - name: Prevent metadata.rb file change | ||
| uses: xalvarez/prevent-file-change-action@v2 | ||
| with: | ||
| githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
| pattern: metadata.rb | ||
| trustedAuthors: sous-chefs | ||
|
|
||
| prevent-workflow-change: | ||
Stromweld marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read | ||
| steps: | ||
| - name: Prevent workflow file change | ||
| uses: xalvarez/prevent-file-change-action@v2 | ||
| with: | ||
| githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
| pattern: .github/workflows | ||
| trustedAuthors: sous-chefs | ||
| closePR: true | ||
| allowNewFiles: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| name: release-please | ||
|
|
||
| "on": | ||
| push: | ||
| tags: ["v*.*.*"] | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| attestations: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_created: ${{ steps.release.outputs.release_created }} | ||
| tag_name: ${{ steps.release.outputs.tag_name }} | ||
| upload_url: ${{ steps.release.outputs.upload_url }} | ||
| steps: | ||
| - uses: googleapis/release-please-action@v4 | ||
| id: release | ||
| with: | ||
| token: ${{ secrets.PORTER_GITHUB_TOKEN }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| if: ${{ steps.release.outputs.release_created }} | ||
|
|
||
| - name: Upload cookbook as artifact | ||
| if: ${{ steps.release.outputs.release_created }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: haproxy-cookbook-${{ steps.release.outputs.tag_name }} | ||
| path: | | ||
| . | ||
| !.git/ | ||
| !.github/ | ||
| !.kitchen/ | ||
| !.vscode/ | ||
| !documentation/ | ||
| !.gitignore | ||
| !test/ | ||
| !spec/ | ||
| retention-days: 90 | ||
| compression-level: 6 | ||
|
|
||
| - name: Generate artifact attestation | ||
| if: ${{ steps.release.outputs.release_created }} | ||
| uses: actions/attest-build-provenance@v1 | ||
| with: | ||
| subject-name: haproxy-cookbook-${{ steps.release.outputs.tag_name }} | ||
|
|
||
| publish-to-supermarket: | ||
| needs: release-please | ||
| if: ${{ needs.release-please.outputs.release_created }} | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: chef/chefworkstation:latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Configure Chef credentials | ||
| run: | | ||
| mkdir -p ~/.chef | ||
| echo "${{ secrets.CHEF_SUPERMARKET_KEY }}" > ~/.chef/supermarket.pem | ||
| chmod 600 ~/.chef/supermarket.pem | ||
|
|
||
| - name: Publish to Chef Supermarket | ||
| run: | | ||
| knife supermarket share haproxy \ | ||
| --supermarket-site https://supermarket.chef.io \ | ||
| --key ~/.chef/supermarket.pem \ | ||
| --user-name ${{ secrets.CHEF_SUPERMARKET_USER }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "releaseType": "ruby", | ||
| "changelogPath": "CHANGELOG.md", | ||
| "versionFile": "version.rb", | ||
| "includeComponentInTag": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| ".": "12.4.1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| VERSION = '12.4.1'.freeze |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.