Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Prepare release script
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Mar 3, 2020
1 parent f2b4482 commit b935ffa
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
release:
types: [created, published]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: NPM
run: npm install
- name: Publish
run: npm run release
env:
VER: ${{ github.ref }}
WEXT_SHIPIT_CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
WEXT_SHIPIT_CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
WEXT_SHIPIT_CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
WEXT_SHIPIT_CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
WEXT_SHIPIT_FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
WEXT_SHIPIT_FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on: [push]
# schedule:
# - cron: '0 4 * * *'

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- name: Generate release name
id: release_name
run: |
echo "::set-output name=version::$(npx daily-version)"
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_name.outputs.version }}
release_name: Release ${{ steps.release_name.outputs.version }}
- name: Publish
run: npm run release
env:
VER: ${{ steps.release_name.outputs.version }}
WEXT_SHIPIT_CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
WEXT_SHIPIT_CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
WEXT_SHIPIT_CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
WEXT_SHIPIT_CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
WEXT_SHIPIT_FIREFOX_JWT_ISSUER: ${{ secrets.JWT_USER }}
WEXT_SHIPIT_FIREFOX_JWT_SECRET: ${{ secrets.JWT_SECRET }}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
"test": "npm run lint && cross-env BABEL_ENV=testing ava && run-s build",
"build": "webpack --mode=production -p",
"start": "webpack --mode=development --watch",
"release:amo": "shipit firefox distribution",
"release:cws": "shipit chrome distribution",
"publish:amo": "shipit firefox distribution",
"publish:cws": "shipit chrome distribution",
"prerelease:version": "dot-json distribution/manifest.json version $VER",
"prerelease:source-url": "echo https://github.com/DesignandHuman/qui-possede-les-medias/archive/\"${GITHUB_SHA:-$VER}\".zip > distribution/SOURCE_URL",
"release": "VER=$(daily-version) npm-run-all build prerelease:* create-git-tag release:*",
"create-git-tag": "git tag $VER -m $VER && git push origin $VER"
"release": "npm-run-all build prerelease:* publish:*"
},
"dependencies": {
"element-ready": "^4.0.0",
Expand Down

0 comments on commit b935ffa

Please sign in to comment.