fix(fuel-gauge): clam SoC within 0-100 #175
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
branches: ["saga"] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
env: | |
CNAME: world.thingy.rocks | |
WEBSOCKET_ENDPOINT: wss://ouqkjmrbb8.execute-api.eu-central-1.amazonaws.com/2022-11-22 | |
MAP_NAME: thingy-rocks-backend-map | |
COGNITO_IDENTITY_POOL_ID: eu-central-1:09c73822-5984-44ff-be03-db63403fdf59 | |
SENTRY_DSN: https://f0636caa395147fcb07f781d0c1e8e6c@o4504255385174016.ingest.sentry.io/4504255391596544 | |
jobs: | |
next-release: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.nextRelease }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Get current release | |
run: | |
echo "currentRelease=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
- name: Determine next release version | |
uses: nordicsemiconductor/cloud-get-next-version-action@saga | |
id: version | |
with: | |
branch: saga | |
defaultVersion: "${{ env.currentRelease }}-${{ github.sha }}" | |
main: | |
runs-on: ubuntu-latest | |
needs: [next-release] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Keep npm cache around to speed up installs | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: npm ci --no-audit | |
- run: npm test | |
- name: Build | |
env: | |
VERSION: ${{ needs.next-release.outputs.version }} | |
run: | | |
npm run build | |
cp -r ./static ./build | |
cp -r node_modules/svg-country-flags/svg/ ./build/static/flags | |
mkdir ./build/.well-known | |
echo ${{ needs.next-release.outputs.version }} > ./build/.well-known/release | |
- name: Deploy to CloudFlare pages | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
run: | |
npx wrangler pages publish build --project-name thingy-world --branch | |
saga --commit-hash ${{ github.sha }} | |
- name: Semantic release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
continue-on-error: true | |
run: npx semantic-release |