Skip to content

Commit

Permalink
Update to use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Richard committed Aug 7, 2024
1 parent 54e9916 commit 4ecd578
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ jobs:
env:
KEY: ${{ secrets.KEY }}
KEY_PASSPHRASE: ${{ secrets.KEY_PASSPHRASE }}
VERSION: ${{ steps.tag_version.outputs.new_tag }}
- name: Check the tags
run: echo ${{ steps.tag_version.outputs.new_tag }}
run: cat update.json
- name: Upload SWBN
uses: actions/upload-artifact@v4
with:
Expand Down
15 changes: 11 additions & 4 deletions bump.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import fs from 'fs';

const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));
let version = process.env?.VERSION;

if (version) {
version = version.replace('v', '');
} else {
throw new Error('No version found');
}

const manifest = JSON.parse(
fs.readFileSync('./public/.well-known/manifest.webmanifest', 'utf-8'),
);

manifest.version = pkg.version;
manifest.version = version;

fs.writeFileSync(
'./public/.well-known/manifest.webmanifest',
Expand All @@ -15,8 +22,8 @@ fs.writeFileSync(
const updateManifest = {
versions: [
{
version: pkg.version,
src: `/v${pkg.version}/package.swbn`,
version,
src: `/v${version}/package.swbn`,
},
],
};
Expand Down

0 comments on commit 4ecd578

Please sign in to comment.