Skip to content

Commit

Permalink
updated pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
SelligtomGit86 committed Jan 31, 2025
1 parent 616b14b commit 0401c2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
sh ./change-release-version.sh --version ${{ inputs.version }}
- name: Commit files
run: |
echo 'ThisBuild / version := "dev"' > version.sbt
git config --local user.email "biscuit-studio-actions@users.noreply.github.com"
git config --local user.name "biscuit-studio-actions"
git add --all
Expand Down
10 changes: 3 additions & 7 deletions scripts/change-release-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ async function replaceVersionInFiles(filePaths) {
let updatedContent =
content.replace(biscuitStudioVersion, `https://github.com/cloud-apim/otoroshi-biscuit-studio/releases/download/${NEW_STUDIO_VERSION}/otoroshi-biscuit-studio-${NEW_STUDIO_VERSION}.jar`);


updatedContent = updatedContent.replace(
otoroshiVersionRegex,
`https://github.com/MAIF/otoroshi/releases/download/${latestOtoVersion}/otoroshi.jar`
Expand All @@ -63,17 +62,14 @@ async function replaceVersionInFiles(filePaths) {
}

async function updateSbtOto() {

const sbtFilePath = path.join(__dirname, '../build.sbt');

const latestOtoVersion = await fetchLatestOtoroshiRelease()

try {
let data = await fs.readFile(sbtFilePath, 'utf8');
let content = fs.readFileSync('../build.sbt', 'utf8');
const regex = /("fr\.maif" %% "otoroshi" % ")([^"]+)(" % "provided")/;
const updatedData = data.replace(regex, `$1${latestOtoVersion.replace("v", "")}$3`);
const updatedContent = content.replace(regex, `$1${latestOtoVersion.replace("v", "")}$3`);

await fs.writeFile(filePath, updatedData, 'utf8');
fs.writeFileSync('../build.sbt', updatedContent, 'utf8');
console.log('build.sbt updated successfully!');
} catch (err) {
console.error('Error:', err);
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ThisBuild / version := "v0.0.4"
ThisBuild / version := "dev"

0 comments on commit 0401c2d

Please sign in to comment.