Skip to content

Commit

Permalink
Revert workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanxiao committed May 2, 2024
1 parent f3ee846 commit 8ccaed3
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,7 @@ jobs:
needs: lint
steps:
- uses: actions/checkout@v4
- name: Check for version change in pyproject.toml
id: check_version
uses: actions/github-script@v6
with:
script: |
const payload = context.payload;
let changedFiles = [];
for (const commit of payload.commits) {
if (commit.modified) changedFiles = changedFiles.concat(commit.modified);
if (commit.added) changedFiles = changedFiles.concat(commit.added);
if (commit.removed) changedFiles = changedFiles.concat(commit.removed);
}
const isVersionChanged = changedFiles.includes('pyproject.toml');
if (!isVersionChanged) {
console.log("No change in pyproject.toml");
return false;
}
const fs = require('fs');
const content = fs.readFileSync('./pyproject.toml', 'utf8');
const versionRegex = /version = "(\S+)"/;
const match = versionRegex.exec(content);
if (match) {
core.setOutput('new_version', match[1]);
console.log(`Version changed to ${match[1]}`);
return true;
} else {
console.log("Version line not found or unchanged");
return false;
}
result-encoding: string
- name: Publish Package
if: steps.check_version.outputs.new_version
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 8ccaed3

Please sign in to comment.