Skip to content

Create Release

Create Release #32

Workflow file for this run

name: Release & Deploy
on:
schedule:
- cron: '30 0 * * *'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: main
- name: Semver Info
id: semver
uses: cdrani/action-semantic-release-info@fix/current-branch
- name: Update Version
if: steps.semver.outputs.version != ''
run: |
jq --arg chromeVersion "${{ steps.semver.outputs.version }}" \
'.version = $chromeVersion' chrome/manifest.json > chrome/tmp && \
mv chrome/tmp chrome/manifest.json
jq --arg firefoxVersion "${{ steps.semver.outputs.version }}" \
'.version = $firefoxVersion' firefox/manifest.json > firefox/tmp && \
mv firefox/tmp firefox/manifest.json
- name: Commit Changes
if: steps.semver.outputs.version != ''
run: |
git config --local user.name "Github Action"
git config user.email "action@github.com"
git diff --quiet || git commit -a -m "docs: bump version to ${{ steps.semver.outputs.git_tag }}"
git tag ${{ steps.semver.outputs.git_tag }}
- name: Push Changes
if: steps.semver.outputs.version != ''
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
tags: true
- name: Nightly Merge
if: steps.semver.outputs.version != ''
uses: robotology/gh-action-nightly-merge@v1.4.0
with:
allow_ff: true
ff_only: true
stable_branch: 'main'
development_branch: 'develop'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Extension Files
if: steps.semver.outputs.version != ''
run: |
(cd src && zip -r ../Chorus-Chrome.zip .)
(cd chrome && zip -j ../Chorus-Chrome.zip manifest.json)
(cd src && zip -r ../Chorus-FireFox.zip .)
(cd firefox && zip -j ../Chorus-FireFox.zip manifest.json)
- name: Create Release Archive & Notes
if: steps.semver.outputs.version != ''
uses: ncipollo/release-action@v1.12.0
with:
tag: ${{ steps.semver.outputs.git_tag }}
name: ${{ steps.semver.outputs.git_tag }}
body: ${{ steps.semver.outputs.notes }}
artifacts: 'Chorus-Chrome.zip,Chorus-FireFox.zip'
- name: Upload & Publish
if: steps.semver.outputs.version != ''
uses: cdrani/chrome-extension-upload@ci/silent-update-fail
with:
silent-fail: true
file-path: Chorus-Chrome.zip
client-id: ${{ secrets.CLIENT_ID }}
extension-id: ${{ secrets.EXTENSION_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}