Skip to content

Commit 23fdbc4

Browse files
authored
chore: improve open source release workflow and best practices (#767)
* feat: add structured issue templates and security workflow - Add bug report template with platform, version, and reproduction steps - Add feature request template with priority and context fields - Add CodeQL security analysis workflow - Add dependency review for pull requests * fix(ci): update GitHub Actions and Xcode versions - Update actions/cache from v3 to v4 for better performance - Fix Xcode version consistency to 16.3 across workflows - Improve caching reliability and build performance * feat(deps): enhance Dependabot configuration - Add npm and github-actions ecosystem monitoring - Configure consistent commit message prefixes - Add reviewer assignment for dependency updates - Improve dependency management automation * fix(release): improve version update script robustness - Add semantic version format validation - Add file existence checks before modification - Implement error recovery with backup restoration - Add comprehensive error handling and logging - Prevent invalid version formats from being applied * feat(release): enhance semantic-release configuration - Add release-notes-generator for proper GitHub release notes - Configure conventional commits preset with detailed release rules - Add structured changelog generation with categorized sections - Enable success comments and release labeling on issues/PRs - Add missing semantic-release dependencies for enhanced functionality Fixes release automation not generating proper release notes and changelog entries. * fix(release): add attestations permission for GitHub workflow - Add attestations: write permission for enhanced security - Prepare for future SLSA provenance generation - Align with GitHub security best practices * docs(changelog): add missing release entries for v2.31.x - Add v2.31.2 with dependency updates - Add v2.31.1 with storage and realtime bug fixes - Add v2.31.0 with new features and improvements - Organize entries by type: Features, Bug Fixes, Dependencies, Tests - Maintain consistency with existing changelog format * chore(deps): update package-lock.json - Update lockfile for new semantic-release dependencies - Ensure dependency integrity and version consistency * fix(deps): remove reviewer assignment from Dependabot config - Remove hardcoded reviewer assignments - Allow team flexibility in handling dependency updates - Rely on CODEOWNERS for review assignments instead * fix(security): run CodeQL analysis on macOS runner - Change from ubuntu-latest to macos-latest for Swift CodeQL analysis - Swift analysis requires macOS environment to function properly - Resolves IncompatibleOs error in CodeQL autobuild process * chore: remove release-please manifest file - Remove .release-please-manifest.json as project migrated to semantic-release - Clean up obsolete release-please configuration - Semantic-release handles version management automatically * fix(security): use manual build for CodeQL analysis - Replace autobuild with manual xcodebuild command targeting Supabase library - Use macOS destination and Debug configuration as per Makefile settings - Skip macro validation for compatibility - Prevents CodeQL from building Examples target instead of main library * refactor(security): use Makefile for CodeQL build step - Replace inline xcodebuild with standardized Makefile target - Use PLATFORM=MACOS and XCODEBUILD_ARGUMENT=build parameters - Ensures consistency with project build conventions - Leverages existing build configuration and flags * chore: remove disabled workflows and improve release dependency - Remove .github/workflows_disabled directory with obsolete workflow files - Add CI dependency check to release workflow to ensure all tests pass - Wait for CI workflow completion before allowing releases - Clean up repository from unused workflow configurations
1 parent a32faf2 commit 23fdbc4

19 files changed

+365
-512
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Bug Report
2+
description: File a bug report to help us improve
3+
title: "[Bug]: "
4+
labels: ["bug", "triage"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
13+
- type: input
14+
id: version
15+
attributes:
16+
label: Version
17+
description: What version of supabase-swift are you running?
18+
placeholder: ex. 2.31.2
19+
validations:
20+
required: true
21+
22+
- type: dropdown
23+
id: platform
24+
attributes:
25+
label: Platform
26+
description: What platform are you using?
27+
options:
28+
- iOS
29+
- macOS
30+
- tvOS
31+
- watchOS
32+
- visionOS
33+
- Linux
34+
- Other
35+
validations:
36+
required: true
37+
38+
- type: input
39+
id: swift-version
40+
attributes:
41+
label: Swift Version
42+
description: What version of Swift are you using?
43+
placeholder: ex. 5.10
44+
validations:
45+
required: true
46+
47+
- type: textarea
48+
id: what-happened
49+
attributes:
50+
label: What happened?
51+
description: Also tell us, what did you expect to happen?
52+
placeholder: Tell us what you see!
53+
validations:
54+
required: true
55+
56+
- type: textarea
57+
id: reproduce
58+
attributes:
59+
label: Steps to Reproduce
60+
description: Please provide clear steps to reproduce the issue
61+
placeholder: |
62+
1. Import Supabase
63+
2. Create client with '...'
64+
3. Call method '...'
65+
4. See error
66+
validations:
67+
required: true
68+
69+
- type: textarea
70+
id: code-sample
71+
attributes:
72+
label: Code Sample
73+
description: Please provide a minimal code sample that reproduces the issue
74+
render: swift
75+
76+
- type: textarea
77+
id: logs
78+
attributes:
79+
label: Relevant log output
80+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
81+
render: shell
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Feature Request
2+
description: Suggest an idea for supabase-swift
3+
title: "[Feature]: "
4+
labels: ["enhancement", "triage"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for suggesting a new feature! Please fill out the sections below.
12+
13+
- type: checkboxes
14+
id: search
15+
attributes:
16+
label: Searched existing issues?
17+
description: Please search existing issues to avoid duplicates
18+
options:
19+
- label: I have searched the existing issues
20+
required: true
21+
22+
- type: textarea
23+
id: problem
24+
attributes:
25+
label: Problem Description
26+
description: Is your feature request related to a problem? Please describe.
27+
placeholder: I'm always frustrated when...
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: solution
33+
attributes:
34+
label: Proposed Solution
35+
description: Describe the solution you'd like
36+
placeholder: I would like to see...
37+
validations:
38+
required: true
39+
40+
- type: textarea
41+
id: alternatives
42+
attributes:
43+
label: Alternative Solutions
44+
description: Describe any alternative solutions or features you've considered
45+
46+
- type: dropdown
47+
id: priority
48+
attributes:
49+
label: Priority
50+
description: How important is this feature to you?
51+
options:
52+
- Low - Nice to have
53+
- Medium - Would significantly improve my workflow
54+
- High - Blocking my use case
55+
validations:
56+
required: true
57+
58+
- type: textarea
59+
id: context
60+
attributes:
61+
label: Additional Context
62+
description: Add any other context, screenshots, or examples about the feature request

.github/dependabot.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "swift" # See documentation for possible values
9-
directory: "/" # Location of package manifests
8+
- package-ecosystem: "swift"
9+
directory: "/"
1010
schedule:
1111
interval: "weekly"
12+
commit-message:
13+
prefix: "chore(deps)"
14+
include: "scope"
15+
- package-ecosystem: "npm"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"
19+
commit-message:
20+
prefix: "chore(deps)"
21+
include: "scope"
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "weekly"
26+
commit-message:
27+
prefix: "chore(deps)"
28+
include: "scope"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: List available devices
7373
run: xcrun simctl list devices available
7474
- name: Cache derived data
75-
uses: actions/cache@v3
75+
uses: actions/cache@v4
7676
with:
7777
path: |
7878
~/.derivedData
@@ -134,15 +134,15 @@ jobs:
134134
steps:
135135
- uses: actions/checkout@v4
136136
- name: Cache derived data
137-
uses: actions/cache@v3
137+
uses: actions/cache@v4
138138
with:
139139
path: ~/.derivedData
140140
key: |
141141
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
142142
restore-keys: |
143143
deriveddata-examples-
144-
- name: Select Xcode 16
145-
run: sudo xcode-select -s /Applications/Xcode_16.0.app
144+
- name: Select Xcode 16.3
145+
run: sudo xcode-select -s /Applications/Xcode_16.3.app
146146
- name: Set IgnoreFileSystemDeviceInodeChanges flag
147147
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
148148
- name: Update mtime for incremental builds

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ permissions:
1111
contents: read
1212

1313
jobs:
14+
check-ci-status:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Wait for CI workflow
18+
uses: lewagon/[email protected]
19+
with:
20+
ref: ${{ github.ref }}
21+
check-name: 'CI'
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
wait-interval: 30
24+
1425
release:
1526
runs-on: ubuntu-latest
1627
if: "!contains(github.event.head_commit.message, 'skip ci')"
28+
needs: [check-ci-status]
1729
permissions:
1830
contents: write
1931
issues: write
2032
pull-requests: write
2133
id-token: write
34+
attestations: write
2235

2336
steps:
2437
- name: Generate token

.github/workflows/security.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 0 * * 1' # Weekly on Mondays
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
codeql:
18+
name: CodeQL Analysis
19+
runs-on: macos-latest
20+
timeout-minutes: 360
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ swift ]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
queries: +security-and-quality
35+
36+
- name: Build Supabase library
37+
run: make XCODEBUILD_ARGUMENT=build PLATFORM=MACOS xcodebuild
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v3
41+
with:
42+
category: "/language:${{matrix.language}}"
43+
44+
dependency-review:
45+
name: Dependency Review
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'pull_request'
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
- name: Dependency Review
52+
uses: actions/dependency-review-action@v4
53+
with:
54+
fail-on-severity: moderate

.github/workflows_disabled/auth.yml

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

.github/workflows_disabled/functions.yml

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

0 commit comments

Comments
 (0)