Skip to content

Commit 204e9aa

Browse files
committed
feat(experimental-release): create the workflow with a more intent-revealing name
1 parent f5448b8 commit 204e9aa

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

src/semantic-release/ci-providers/github-workflows/release-workflow-for-alpha/scaffolder-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ suite('github release workflow scaffolder', () => {
5151

5252
await scaffoldReleaseWorkflow({projectRoot, nodeVersion});
5353

54-
assert.calledWith(fs.writeFile, `${workflowsDirectory}/release.yml`, dumpedWorkflowYaml);
54+
assert.calledWith(fs.writeFile, `${workflowsDirectory}/experimental-release.yml`, dumpedWorkflowYaml);
5555
});
5656
});

src/semantic-release/ci-providers/github-workflows/release-workflow-for-alpha/scaffolder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async function ({projectRoot, nodeVersion}) {
66
await writeConfigFile({
77
format: fileTypes.YAML,
88
path: `${projectRoot}/.github/workflows`,
9-
name: 'release',
9+
name: 'experimental-release',
1010
config: {
1111
name: 'Release',
1212
on: {push: {branches: ['alpha']}},

test/integration/features/lift/lifter.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Feature: Lift
44
Given semantic-release is configured
55
And legacy releases are configured in a GitHub workflow
66
When the project is lifted
7-
Then the release workflow calls the reusable workflow for alpha branches
7+
Then the experimental release workflow calls the reusable workflow for alpha branches
88
And the verification workflow calls the reusable release workflow
99

1010
Scenario: cycjimmy action in a GitHub workflow
1111
Given semantic-release is configured
1212
And the cycjimmy action is configured in a GitHub workflow
1313
When the project is lifted
14-
Then the release workflow calls the reusable workflow for alpha branches
14+
Then the experimental release workflow calls the reusable workflow for alpha branches
1515
And the verification workflow calls the reusable release workflow
1616
And the cycjimmy action was removed
1717

@@ -20,14 +20,14 @@ Feature: Lift
2020
And the release workflow is called from the ci workflow
2121
And a release workflow is defined for alpha
2222
When the project is lifted
23-
Then the release workflow calls the reusable workflow for alpha branches
23+
Then the experimental release workflow calls the reusable workflow for alpha branches
2424

2525
Scenario: modern semantic-release in GitHub workflows, but trigger does not wait for verification
2626
Given semantic-release is configured
2727
And the release workflow is called from the ci workflow
2828
And a release workflow is defined for alpha
2929
When the project is lifted
30-
Then the release workflow calls the reusable workflow for alpha branches
30+
Then the experimental release workflow calls the reusable workflow for alpha branches
3131
And the release is not called until verification completes
3232

3333
Scenario: modern semantic-release in GitHub workflows verifying multiple node versions, but trigger does not wait for verification
@@ -36,14 +36,14 @@ Feature: Lift
3636
And a release workflow is defined for alpha
3737
And multiple node versions are verified
3838
When the project is lifted
39-
Then the release workflow calls the reusable workflow for alpha branches
39+
Then the experimental release workflow calls the reusable workflow for alpha branches
4040
And the release is not called until verification completes
4141

4242
Scenario: no existing release
4343
Given semantic-release is configured
4444
And no release is configured in a GitHub workflow
4545
When the project is lifted
46-
Then the release workflow calls the reusable workflow for alpha branches
46+
Then the experimental release workflow calls the reusable workflow for alpha branches
4747
And the verification workflow calls the reusable release workflow
4848

4949
Scenario: no release needed
@@ -64,5 +64,5 @@ Feature: Lift
6464
And a local release workflow is defined
6565
And the release workflow is triggered from the ci workflow
6666
When the project is lifted
67-
Then the release workflow calls the reusable workflow for alpha branches
67+
Then the experimental release workflow calls the reusable workflow for alpha branches
6868
And the verification workflow calls the reusable release workflow

test/integration/features/lift/older-node.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Feature: older node version
55
And semantic-release is configured
66
And no release is configured in a GitHub workflow
77
When the project is lifted
8-
Then the release workflow calls the reusable workflow for semantic-release v19 for alpha branches
8+
Then the experimental release workflow calls the reusable workflow for semantic-release v19 for alpha branches
99
And the verification workflow calls the reusable release workflow for semantic-release v19

test/integration/features/step_definitions/github-workflows-steps.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ import {assert} from 'chai';
66
import {load} from 'js-yaml';
77

88
async function loadReleaseWorkflowDefinition() {
9-
assert.isTrue(await fileExists(`${process.cwd()}/.github/workflows/release.yml`), 'Release workflow is missing');
9+
assert.isTrue(
10+
await fileExists(`${process.cwd()}/.github/workflows/experimental-release.yml`),
11+
'Release workflow is missing'
12+
);
1013

11-
const {on: triggers, jobs} = load(await fs.readFile(`${process.cwd()}/.github/workflows/release.yml`, 'utf-8'));
14+
const {on: triggers, jobs} = load(
15+
await fs.readFile(`${process.cwd()}/.github/workflows/experimental-release.yml`, 'utf-8')
16+
);
1217

1318
return {triggers, jobs};
1419
}
@@ -68,21 +73,27 @@ Given('no GitHub workflows exist', async function () {
6873
this.githubWorkflows = false;
6974
});
7075

71-
Then('the release workflow calls the reusable workflow for alpha branches', async function () {
76+
Then('the experimental release workflow calls the reusable workflow for alpha branches', async function () {
7277
const {triggers, jobs} = await loadReleaseWorkflowDefinition();
7378

7479
assert.isUndefined(triggers.workflow_dispatch);
7580
assert.deepEqual(triggers.push.branches, ['alpha']);
7681
assert.equal(jobs.release.uses, 'form8ion/.github/.github/workflows/release-package.yml@master');
7782
});
7883

79-
Then('the release workflow calls the reusable workflow for semantic-release v19 for alpha branches', async function () {
80-
const {triggers, jobs} = await loadReleaseWorkflowDefinition();
84+
Then(
85+
'the experimental release workflow calls the reusable workflow for semantic-release v19 for alpha branches',
86+
async function () {
87+
const {triggers, jobs} = await loadReleaseWorkflowDefinition();
8188

82-
assert.isUndefined(triggers.workflow_dispatch);
83-
assert.deepEqual(triggers.push.branches, ['alpha']);
84-
assert.equal(jobs.release.uses, 'form8ion/.github/.github/workflows/release-package-semantic-release-19.yml@master');
85-
});
89+
assert.isUndefined(triggers.workflow_dispatch);
90+
assert.deepEqual(triggers.push.branches, ['alpha']);
91+
assert.equal(
92+
jobs.release.uses,
93+
'form8ion/.github/.github/workflows/release-package-semantic-release-19.yml@master'
94+
);
95+
}
96+
);
8697

8798
Then('the release workflow is not defined', async function () {
8899
assert.isFalse(await fileExists(`${process.cwd()}/.github/workflows/release.yml`));

0 commit comments

Comments
 (0)