Skip to content

Commit

Permalink
test release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ldennington committed Apr 27, 2023
1 parent 09a3a74 commit eeb93a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 66 deletions.
66 changes: 0 additions & 66 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -750,69 +750,3 @@ jobs:
mkdir win-x86-payload-and-symbols
zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION.zip win-sign/signed-payload
zip -jr win-x86-payload-and-symbols/gcm-win-x86-$VERSION-symbols.zip win-sign/src/windows/Installer.Windows/symbols
- uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const path = require('path');
const version = process.env.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,
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('win-sign/signed'),
uploadDirectoryToRelease('win-x86-payload-and-symbols'),
// Upload macOS artifacts
uploadDirectoryToRelease('osx-x64-sign'),
uploadDirectoryToRelease('osx-arm64-sign'),
uploadDirectoryToRelease('osx-payload-and-symbols'),
// Upload Linux artifacts
uploadDirectoryToRelease('linux-build/tar'),
uploadDirectoryToRelease('linux-sign'),
// Upload .NET tool package
uploadDirectoryToRelease('dotnet-tool-sign'),
]);
- name: Publish .NET tool to nuget.org
run: |
dotnet nuget push dotnet-tool-sign/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
21 changes: 21 additions & 0 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release

on:
push

jobs:
# ================================
# macOS
# ================================
get-version:
name: Get version
runs-on: macos-latest
steps:
- name: Check out repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8

- name: Set version environment variable
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Use version environment variable
run: echo "Version is $VERSION"
1 change: 1 addition & 0 deletions .github/workflows/validate-install-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- update-versioning

jobs:
docker:
Expand Down

0 comments on commit eeb93a1

Please sign in to comment.