Skip to content

Commit

Permalink
chore: release workflow trigger on published and prereleased only
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Sep 17, 2024
1 parent d0819aa commit 4dac651
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Create and upload release artifacts
on:
release:
types: [published, prereleased]
# temporary PR trigger for test
pull_request:
branches:
- develop
- 'features/**'

jobs:
release-artifacts:
Expand Down Expand Up @@ -43,21 +38,19 @@ jobs:
script: |
const fs = require("fs");
// temporary hardcoding for test
const tag = "v8.0.2-test";
// const tag = context.ref.replace("refs/tags/", "");
console.log("tag = ", tag);
// get tag
const tag = context.ref.replace("refs/tags/", "");
// get release from tag
const release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag,
});
console.log("release id = ", release.data.id)
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: "json-schemas-clean.zip",
name: "json-schemas.zip",
data: await fs.readFileSync("./json-schemas.zip"),
});

0 comments on commit 4dac651

Please sign in to comment.