Skip to content

Production Deployment #45

Production Deployment

Production Deployment #45

name: Production Deployment
on:
workflow_dispatch:
inputs:
version:
description: New Version
default: "1.0.0"
required: true
jobs:
bump-version:
name: Bump Package Version and Submit Extension
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Update package.json version
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/package.json
field: version
value: ${{ github.event.inputs.version }}
- name: Update manifest-v2.json version_name
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest/v2.json
field: version_name
value: ${{ github.event.inputs.version }}
- name: Update manifest-v3.json version_name
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest/v3.json
field: version_name
value: ${{ github.event.inputs.version }}
- name: Get manifest.json version
id: manifest_version
uses: frabert/replace-string-action@4ec615c8a75164a61d8fb333ad5e2e86ff038af1 #v1.2
with:
string: ${{ github.event.inputs.version }}
pattern: \-(.*)
replace-with: ""
- name: Update manifest-v2.json version
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest/v2.json
field: version
value: ${{ steps.manifest_version.outputs.replaced }}
- name: Update manifest-v3.json version
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest/v3.json
field: version
value: ${{ steps.manifest_version.outputs.replaced }}
- name: Build extension
uses: actions/setup-node@v1
with:
node-version: "16.14"
- run: yarn install && yarn build:freighter-api && yarn build:extension:production --define 'process.env.AMPLITUDE_KEY="${{ secrets.AMPLITUDE_KEY }}"' --define 'process.env.SENTRY_KEY="${{ secrets.SENTRY_KEY }}"'
- name: Install zip
uses: montudor/action-zip@c25e01d7489d0274569440a2f0281b4569df16bc #v0.1.1
- name: Zip extension build
run: zip -qq -r ./build.zip *
working-directory: ./extension/build
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "docs(): bumping release to ${{ github.event.inputs.version }}"
git tag ${{ github.event.inputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@7380612b49221684fefa025244f2ef4008ae50ad #v3.10.1
with:
title: Bump versions to ${{ github.event.inputs.version }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: ${{ github.event.inputs.version }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./extension/build/build.zip
asset_name: build-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
- name: Submit extension to Firefox
uses: kewisch/action-web-ext@a28b4ba2f491cc36c67a714a716ca54218440056 #v1
with:
cmd: sign
source: ./extension/build/build.zip
channel: listed
apiKey: ${{ secrets.AMO_SIGN_KEY }}
apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
timeout: 900000
- name: Submit extension to Chrome
uses: mnao305/chrome-extension-upload@cf3c0991d2106541415f20bec91619ff72d03293 #v1.1.1
with:
file-path: ./extension/build/build.zip
extension-id: "bcacfldlkkdogcmkkibnjlakofdplcbk"
client-id: ${{ secrets.EXTENSION_CLIENT_ID }}
client-secret: ${{ secrets.EXTENSION_CLIENT_SECRET }}
refresh-token: ${{ secrets.EXTENSION_REFRESH_TOKEN }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@4d4ce0d91186ffe6633a8cda645146d38e88228b #v2
env:
MSG_MINIMAL: true
SLACK_CHANNEL: proj-freighter
SLACK_COLOR: "#391EDA"
SLACK_ICON: https://github.com/stellar/freighter/blob/master/docs/static/images/logo.png?size=48
SLACK_MESSAGE: "https://github.com/stellar/freighter/releases/tag/${{ github.event.inputs.version }}"
SLACK_TITLE: Freighter v${{ github.event.inputs.version }} has been submitted to app stores for review!
SLACK_USERNAME: Freighter Administrative Assistant
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}