Skip to content

Production Deployment #113

Production Deployment

Production Deployment #113

name: Production Deployment
env:
INDEXER_URL: ${{ secrets.INDEXER_URL }}
HUSKY: 0
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@v4
- name: Update package.json version
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 #v2
with:
file: ./extension/package.json
field: version
value: ${{ github.event.inputs.version }}
- name: Update manifest-v3.json version_name
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 #v2
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@b6828c5a4cb6371753ff873b0d1c4c4fbd9a63cb #v2.5
with:
string: ${{ github.event.inputs.version }}
pattern: \-(.*)
replace-with: ""
- name: Update manifest-v3.json version
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 #v2
with:
file: ./extension/public/static/manifest/v3.json
field: version
value: ${{ steps.manifest_version.outputs.replaced }}
- name: Build extension
uses: actions/setup-node@v4
with:
node-version: "18"
- run: yarn setup && yarn build:freighter-api && yarn build:extension:production --env AMPLITUDE_KEY="${{ secrets.AMPLITUDE_KEY }}" SENTRY_KEY="${{ secrets.SENTRY_KEY }}"
- name: Install zip
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 #v1.0.0
- 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@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
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@2c96cb8d05464c1dd52b96229a9f33388ba1bfad #v1
with:
cmd: sign
source: ./extension/build/build.zip
channel: listed
apiKey: ${{ secrets.AMO_SIGN_KEY }}
apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
timeout: 900000
- name: Remove scripts tag
uses: restackio/update-json-file-action@a3a75ee5960338f5bcc83bfb81947f283fca90eb #v2.1
with:
file: ./extension/build/manifest.json
fields: '{"background": {"service_worker": "background.min.js"}}'
- name: Zip Chrome build
run: zip -qq -r ./build_chrome.zip *
working-directory: ./extension/build
- name: Submit extension to Chrome
uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 #v5.0.0
with:
file-path: ./extension/build/build_chrome.zip
extension-id: "bcacfldlkkdogcmkkibnjlakofdplcbk"
client-id: ${{ secrets.EXTENSION_CLIENT_ID }}
client-secret: ${{ secrets.EXTENSION_CLIENT_SECRET }}
refresh-token: ${{ secrets.EXTENSION_REFRESH_TOKEN }}
# - name: Submit extension to Edge
# uses: wdzeng/edge-addon@v1
# with:
# product-id: ${{ secrets.EDGE_PRODUCT_ID }}
# zip-path: ${{ secrets.EDGE_ZIP_PATH }}
# client-id: ${{ secrets.EDGE_CLIENT_ID }}
# client-secret: ${{ secrets.EDGE_CLIENT_SECRET }}
# access-token-url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 #v2.3.0
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 }}