Skip to content

Commit abebf70

Browse files
committed
Add skip-publish option for applications like Reframe
- Add skip-publish input to reusable workflow - Configure Reframe to skip crates.io publishing - Update application template with skip-publish: true - Reframe now only runs tests, creates git tags, and GitHub releases - No attempt to publish to crates.io for applications This properly handles applications that are distributed as binaries rather than crates, avoiding unnecessary crates.io operations.
1 parent 9fb46d6 commit abebf70

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/release-reframe.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
repository: GoPlasmatic/Reframe
1717
package-type: application
18+
skip-publish: true # Reframe is not published to crates.io
1819
dry-run: ${{ inputs.dry_run }}
1920
secrets:
2021
GH_PAT: ${{ secrets.GH_PAT }}

.github/workflows/rust-release-reusable.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
required: false
1313
type: string
1414
default: 'library'
15+
skip-publish:
16+
description: 'Skip publishing to crates.io (for applications or testing)'
17+
required: false
18+
type: boolean
19+
default: false
1520
dry-run:
1621
description: 'Dry run (skip publishing)'
1722
required: false
@@ -109,7 +114,7 @@ jobs:
109114
echo "Main package: $PACKAGE_NAME v$PACKAGE_VERSION (workspace: $PACKAGE_COUNT packages)"
110115
111116
- name: Check if version exists on crates.io
112-
if: inputs.package-type == 'library'
117+
if: inputs.package-type == 'library' && inputs.skip-publish != true
113118
id: check_crates
114119
run: |
115120
CRATE_VERSION=$(curl -s https://crates.io/api/v1/crates/${{ steps.package_info.outputs.name }} | jq -r '.crate.max_version // "none"')
@@ -206,7 +211,7 @@ jobs:
206211
files: ${{ inputs.package-type == 'application' && format('{0}-v{1}-linux-x86_64.tar.gz', steps.package_info.outputs.name, steps.package_info.outputs.version) || '' }}
207212

208213
- name: Publish to crates.io (library)
209-
if: inputs.package-type == 'library' && inputs.dry-run != true && steps.check_crates.outputs.exists != 'true'
214+
if: inputs.package-type == 'library' && inputs.skip-publish != true && inputs.dry-run != true && steps.check_crates.outputs.exists != 'true'
210215
env:
211216
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
212217
run: |
@@ -274,6 +279,8 @@ jobs:
274279
echo "✅ Released ${{ steps.package_info.outputs.name }} v${{ steps.package_info.outputs.version }}"
275280
if [ "${{ inputs.package-type }}" = "application" ]; then
276281
echo "📦 Binary package: ${{ steps.package_info.outputs.name }}-v${{ steps.package_info.outputs.version }}-linux-x86_64.tar.gz"
282+
elif [ "${{ inputs.skip-publish }}" = "true" ]; then
283+
echo "📦 Git tag and GitHub release created (no crates.io publish)"
277284
else
278285
echo "📦 Published to crates.io"
279286
fi

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ jobs:
4848
with:
4949
repository: GoPlasmatic/your-repo
5050
package-type: library # or application
51+
skip-publish: false # Set to true for apps not published to crates.io
5152
dry-run: false
5253
secrets:
5354
GH_PAT: ${{ secrets.GH_PAT }}
54-
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
55+
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} # Not needed if skip-publish: true
5556
```
5657
5758
## Features
@@ -97,7 +98,7 @@ Configure as organization-level secrets:
9798
- **datafake-rs** - Fake data generation
9899

99100
### Applications
100-
- **Reframe** - Binary application
101+
- **Reframe** - Binary application (GitHub releases only, not published to crates.io)
101102

102103
## Workspace Support
103104

templates/application-release-caller.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
with:
1717
repository: ${{ github.repository }}
1818
package-type: application
19+
skip-publish: true # Applications typically don't publish to crates.io
1920
dry-run: ${{ inputs.dry_run }}
2021
secrets:
2122
GH_PAT: ${{ secrets.GH_PAT }}

0 commit comments

Comments
 (0)