Skip to content

Commit

Permalink
Release V2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
umair-ably committed Dec 16, 2024
1 parent 27f1025 commit 962ecdb
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 84 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [2.2.0](https://github.com/ably/sdk-upload-action/tree/v2.2.0)

[Full Changelog](https://github.com/ably/sdk-upload-action/compare/v2.1.0...v2.2.0)

[\#57](https://github.com/ably/sdk-upload-action/pull/57) introduces a way to navigate to a particular page when viewing a deployment:
[\#58](https://github.com/ably/sdk-upload-action/pull/58) adds related I/O for obtaining the `base-path` ahead of artifact build.:


- `landingPagePath` input
- `base-path` output

## [2.1.0](https://github.com/ably/sdk-upload-action/tree/v2.1.0)

[Full Changelog](https://github.com/ably/sdk-upload-action/compare/v2.0.0...v2.1.0)
Expand Down
9 changes: 8 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ const sourcePath = path_1.default.resolve(core.getInput('sourcePath', { required
// - The getInput() method calls trim() for us by default (trimWhitespace: true)
// - Empty string indicates no value, i.e. artifact name not specified
const artifactName = core.getInput('artifactName');
// Optional landingPagePath:
// - The getInput() method calls trim() for us by default (trimWhitespace: true)
// - Empty string indicates no value, i.e. landingPagePath not specified
const landingPagePath = core.getInput('landingPagePath');
let githubDeploymentRef;
let s3KeyPrefix = `builds/${github_1.context.repo.owner}/${github_1.context.repo.repo}/`;
let githubEnvironmentName = 'staging/';
Expand Down Expand Up @@ -163,6 +167,7 @@ core.debug(`S3 Key Prefix: ${s3KeyPrefix}`);
core.debug(`GitHub Environment Name: ${githubEnvironmentName}`);
const urlBase = `https://${s3BucketName}/${s3KeyPrefix}/`;
core.setOutput('url-base', urlBase);
core.setOutput('base-path', s3KeyPrefix);
const runMode = core.getInput('mode');
if (runMode === 'preempt') {
process.exit(0);
Expand All @@ -187,7 +192,9 @@ const createDeployment = () => __awaiter(void 0, void 0, void 0, function* () {
return response.data.id;
});
const setDeploymentStatus = (id, state, url) => __awaiter(void 0, void 0, void 0, function* () {
yield octokit.repos.createDeploymentStatus(Object.assign(Object.assign({}, github_1.context.repo), { deployment_id: id, state, log_url: url, target_url: url, environment_url: url, mediaType: {
// Set completeUrl if url exists; otherwise, it will remain undefined
const completeUrl = url ? `${url}${landingPagePath}` : undefined;
yield octokit.repos.createDeploymentStatus(Object.assign(Object.assign({}, github_1.context.repo), { deployment_id: id, state, log_url: completeUrl, target_url: completeUrl, environment_url: completeUrl, mediaType: {
// 'flash' is needed to use the 'in_progress' state
// 'ant-man' is needed to use the log_url property
// see https://octokit.github.io/rest.js/v18#repos-create-deployment-status
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

117 changes: 39 additions & 78 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ably/sdk-upload-action",
"version": "2.1.0",
"version": "2.2.0",
"description": "GitHub Action for use in Ably SDK repository workflows, uploading built artifacts to the SDK Team's Amazon S3 bucket (presented at sdk.ably.com).",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,16 @@ const createDeployment = async () => {
}

const setDeploymentStatus = async (id: number, state: 'in_progress' | 'success' | 'failure', url?: string) => {
// Set completeUrl if url exists; otherwise, it will remain undefined
const completeUrl = url ? `${url}${landingPagePath}` : undefined;

await octokit.repos.createDeploymentStatus({
...context.repo,
deployment_id: id,
state,
log_url: url + landingPagePath,
target_url: url + landingPagePath,
environment_url: url + landingPagePath,
log_url: completeUrl,
target_url: completeUrl,
environment_url: completeUrl,
mediaType: {
// 'flash' is needed to use the 'in_progress' state
// 'ant-man' is needed to use the log_url property
Expand Down

0 comments on commit 962ecdb

Please sign in to comment.