Skip to content

Commit

Permalink
Update release to upload update.json to a fixed release called "upd…
Browse files Browse the repository at this point in the history
…ate"
  • Loading branch information
Dominic-DallOsto committed Sep 18, 2024
1 parent 5aa1d12 commit aa2175d
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 91 deletions.
184 changes: 96 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,96 @@
name: release

on:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: install node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node dependencies
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
path: |
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install node dependencies
run: npm install

- name: build
run: npm run build

release:
runs-on: ubuntu-latest
needs: test
# only trigger when tagged with a version
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: install node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node dependencies
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
path: |
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install node dependencies
run: npm install

- name: build
run: npm run build

- name: release
run: |
npm run release -- --no-increment --no-git --github.release --ci --VV
sleep 1s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify release
uses: apexskier/github-release-commenter@v1
continue-on-error: true
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-template: |
:rocket: _This ticket has been resolved in {release_tag}. See {release_link} for release notes._
name: release

on:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: install node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node dependencies
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
path: |
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install node dependencies
run: npm install

- name: build
run: npm run build

release:
runs-on: ubuntu-latest
needs: test
# only trigger when tagged with a version
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: install node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node dependencies
uses: actions/cache@v4
env:
cache-name: cache-dependencies
with:
path: |
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install node dependencies
run: npm install

- name: build
run: npm run build

- name: release
run: |
npm run release -- --no-increment --no-git --github.release --ci --VV
sleep 1s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: update.json
uses: echapmanFromBunnings/[email protected]
with:
releaseTag: 'update'
githubToken: ${{ secrets.GITHUB_TOKEN }}
files: build/update*.json
overrideExistingArtefact: true

- name: Notify release
uses: apexskier/github-release-commenter@v1
continue-on-error: true
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-template: |
:rocket: _This ticket has been resolved in {release_tag}. See {release_link} for release notes._
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,12 @@
"github": {
"release": false,
"assets": [
"build/*.xpi",
"build/update*.json"
"build/*.xpi"
]
},
"hooks": {
"before:init": "npm run lint",
"after:bump": "npm run build"
}
}
}
}

0 comments on commit aa2175d

Please sign in to comment.