Skip to content

Commit

Permalink
TEST - disable release creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcheetham committed Jun 26, 2024
1 parent e3facc5 commit cbec20d
Showing 1 changed file with 60 additions and 60 deletions.
120 changes: 60 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,63 +606,63 @@ jobs:
| sed -e 's/^"//' -e 's/"$//' | base64 -d >gcm-public.asc
mv gcm-public.asc linux-artifacts
- uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const version = "${{ needs.prereqs.outputs.version }}"
var releaseMetadata = {
owner: context.repo.owner,
repo: context.repo.repo
};
// Create the release
var tagName = `v${version}`;
var createdRelease = await github.rest.repos.createRelease({
...releaseMetadata,
draft: true,
tag_name: tagName,
target_commitish: context.sha,
name: `GCM ${version}`
});
releaseMetadata.release_id = createdRelease.data.id;
// Uploads contents of directory to the release created above
async function uploadDirectoryToRelease(directory, includeExtensions=[]) {
return fs.promises.readdir(directory)
.then(async(files) => Promise.all(
files.filter(file => {
return includeExtensions.length==0 || includeExtensions.includes(path.extname(file).toLowerCase());
})
.map(async (file) => {
var filePath = path.join(directory, file);
github.rest.repos.uploadReleaseAsset({
...releaseMetadata,
name: file,
headers: {
"content-length": (await fs.promises.stat(filePath)).size
},
data: fs.createReadStream(filePath)
});
}))
);
}
await Promise.all([
// Upload Windows artifacts
uploadDirectoryToRelease('windows-artifacts/installers'),
uploadDirectoryToRelease('win-x86-payload-and-symbols'),
// Upload macOS artifacts
uploadDirectoryToRelease('macos-osx-x64-artifacts/pkg'),
uploadDirectoryToRelease('macos-osx-arm64-artifacts/pkg'),
uploadDirectoryToRelease('osx-payload-and-symbols'),
// Upload Linux artifacts
uploadDirectoryToRelease('linux-artifacts'),
// Upload .NET tool package
uploadDirectoryToRelease('dotnet-tool-sign'),
]);
# - uses: actions/github-script@v7
# with:
# script: |
# const fs = require('fs');
# const path = require('path');
# const version = "${{ needs.prereqs.outputs.version }}"

# var releaseMetadata = {
# owner: context.repo.owner,
# repo: context.repo.repo
# };

# // Create the release
# var tagName = `v${version}`;
# var createdRelease = await github.rest.repos.createRelease({
# ...releaseMetadata,
# draft: true,
# tag_name: tagName,
# target_commitish: context.sha,
# name: `GCM ${version}`
# });
# releaseMetadata.release_id = createdRelease.data.id;

# // Uploads contents of directory to the release created above
# async function uploadDirectoryToRelease(directory, includeExtensions=[]) {
# return fs.promises.readdir(directory)
# .then(async(files) => Promise.all(
# files.filter(file => {
# return includeExtensions.length==0 || includeExtensions.includes(path.extname(file).toLowerCase());
# })
# .map(async (file) => {
# var filePath = path.join(directory, file);
# github.rest.repos.uploadReleaseAsset({
# ...releaseMetadata,
# name: file,
# headers: {
# "content-length": (await fs.promises.stat(filePath)).size
# },
# data: fs.createReadStream(filePath)
# });
# }))
# );
# }

# await Promise.all([
# // Upload Windows artifacts
# uploadDirectoryToRelease('windows-artifacts/installers'),
# uploadDirectoryToRelease('win-x86-payload-and-symbols'),

# // Upload macOS artifacts
# uploadDirectoryToRelease('macos-osx-x64-artifacts/pkg'),
# uploadDirectoryToRelease('macos-osx-arm64-artifacts/pkg'),
# uploadDirectoryToRelease('osx-payload-and-symbols'),

# // Upload Linux artifacts
# uploadDirectoryToRelease('linux-artifacts'),

# // Upload .NET tool package
# uploadDirectoryToRelease('dotnet-tool-sign'),
# ]);

0 comments on commit cbec20d

Please sign in to comment.