Skip to content
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

fix(release): use correct steps when publishing Go modules #448

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/force-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class ForceRelease {
{
name: "Upload artifact",
uses: "actions/upload-artifact",
with: { name: "build-artifact", path: "dist" },
with: { name: "build-artifact", path: "dist", overwrite: true },
},
],
});
Expand All @@ -104,7 +104,7 @@ export class ForceRelease {
{
name: "Setup Go",
uses: "actions/setup-go",
with: { "go-version": "^1.16.0" },
with: { "go-version": "^1.18.0" },
},
{
name: "Download build artifacts",
Expand All @@ -117,15 +117,26 @@ export class ForceRelease {
continueOnError: true,
},
{
name: "Prepare Repository",
run: "mv dist .repo",
name: "Checkout",
uses: "actions/checkout",
with: {
path: ".repo",
},
},
{
name: "Install Dependencies",
run: "cd .repo && yarn install --check-files --frozen-lockfile",
},
{
name: "Create Artifact",
name: "Extract build artifact",
run: "tar --strip-components=1 -xzvf dist/js/*.tgz -C .repo",
},
{
name: "Move build artifact out of the way",
run: "mv dist dist.old",
},
{
name: "Create go artifact",
run: "cd .repo && npx projen package:go",
},
{
Expand Down
15 changes: 13 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,24 @@ export class CdktfProviderProject extends cdk.JsiiProject {
// If someone knows a better way to do this mutation with minimal custom code, please do so
prePublishSteps: [
{
name: "Prepare Repository",
run: "mv dist .repo",
name: "Checkout",
uses: "actions/checkout",
with: {
path: ".repo",
},
},
{
name: "Install Dependencies",
run: "cd .repo && yarn install --check-files --frozen-lockfile",
},
{
name: "Extract build artifact",
run: "tar --strip-components=1 -xzvf dist/js/*.tgz -C .repo",
},
{
name: "Move build artifact out of the way",
run: "mv dist dist.old",
},
{
name: "Create go artifact",
run: "cd .repo && npx projen package:go",
Expand Down
110 changes: 84 additions & 26 deletions test/__snapshots__/index.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.