Rotate units on balance (#506) #67
Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'v*' | |
name: Release | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
release: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# setup nodejs | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
# get current tag | |
- name: tag | |
id: next_tag | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | |
- name: version | |
id: next_version | |
run: | | |
tag=${{ steps.next_tag.outputs.tag }} | |
echo ::set-output name=version::${tag:1} | |
- name: Increment manifest v2 version | |
run: | | |
jq '.version = "${{ steps.next_version.outputs.version }}"' ./manifest/manifest.v2.json > ./manifest/manifest.v2.tmp.json | |
mv ./manifest/manifest.v2.tmp.json ./manifest/manifest.v2.json | |
- name: Increment manifest v3 version | |
run: | | |
jq '.version = "${{ steps.next_version.outputs.version }}"' ./manifest/manifest.v3.json > ./manifest/manifest.v3.tmp.json | |
mv ./manifest/manifest.v3.tmp.json ./manifest/manifest.v3.json | |
- name: Increment package.json version | |
run: | | |
jq '.version = "${{ steps.next_version.outputs.version }}"' package.json > package.tmp.json | |
mv package.tmp.json package.json | |
- name: Install the dependencies | |
run: yarn install | |
# Build extension v3 | |
- name: Build extension manifest v3 | |
run: | | |
yarn build:v3 | |
yarn web-ext:build:v3 | |
# Build extension v2 | |
- name: Build extension manifest v2 | |
run: | | |
yarn build | |
yarn web-ext:build | |
# Release to github | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
- name: Upload release (manifest v3) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./web-ext-artifacts/v3/marina-${{ steps.next_version.outputs.version }}.zip | |
asset_name: marina-v3-${{ steps.next_version.outputs.version }}.zip | |
asset_content_type: application/zip | |
- name: Upload release (manifest v2) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./web-ext-artifacts/v2/marina-${{ steps.next_version.outputs.version }}.zip | |
asset_name: marina-v2-${{ steps.next_version.outputs.version }}.zip | |
asset_content_type: application/zip | |
# Comit manifest and package.json to master | |
- name: Commit & Push | |
run: | | |
git config --local user.email "$(git log --format='%ae' HEAD^!)" | |
git config --local user.name "$(git log --format='%an' HEAD^!)" | |
git add . | |
git commit -m "${{ steps.next_tag.outputs.tag }}" | |
git push origin HEAD:master |