This repository has been archived on 2023-12-17. You can view files and clone it, but cannot push or open issues or pull requests.
extension/.github/workflows/ci.yml

71 lines
2.7 KiB
YAML
Raw Permalink Normal View History

2023-08-07 00:03:08 +00:00
name: Build/Publish
on:
push:
branches:
- master
- develop
- develop-*
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
- name: Install APT Packages
run: sudo apt-get install rename -y
2023-08-07 00:03:08 +00:00
- run: npm ci
- run: npm run build --if-present
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.GITEA_SSH_KEY }}
known_hosts: ${{ secrets.GITEA_KNOWN_HOST }}
- name: Download YQ
run: |
2023-08-07 03:14:34 +00:00
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq;
sudo chmod +x /usr/bin/yq
2023-08-07 00:03:08 +00:00
- name: Set up S3CMD
uses: s3-actions/s3cmd@v1.5.0
with:
2023-08-07 00:53:36 +00:00
provider: cloudflare
account_id: ${{ secrets.CF_ACCOUNT_ID }}
2023-08-07 00:03:08 +00:00
access_key: ${{ secrets.S3_ACCESS_KEY }}
2023-08-07 00:53:36 +00:00
secret_key: ${{ secrets.S3_SECRET_KEY }}
2023-08-07 00:03:08 +00:00
- name: Publish
run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2023-08-07 03:05:48 +00:00
- name: Publish to S3
2023-08-13 17:34:27 +00:00
if: ${{ env.PKG != null }}
2023-08-07 03:05:48 +00:00
run: |
2023-08-07 04:34:49 +00:00
s3cmd put "${{ env.PKG }}" s3://${{ vars.S3_BUCKET }}/$(basename "${{ env.PKG }}")
echo Release Zip: https://extension-release.lumeweb.com/$(basename "${{ env.PKG }}")
2023-08-07 05:12:17 +00:00
echo Release Zip SHA56: $(sha256sum "${{ env.PKG }}" | awk '{print $1}')
2023-08-07 00:03:08 +00:00
- name: Publish to Firefox
uses: yayuyokitano/firefox-addon@v0.0.6-alpha
2023-08-13 17:34:27 +00:00
if: ${{ github.ref_name == 'master' && env.PKG != null }}
2023-08-07 00:03:08 +00:00
with:
api_key: ${{ secrets.AMO_ISSUER }}
api_secret: ${{ secrets.AMO_SECRET }}
guid: ${{ vars.EXTENSION_GUID }}
2023-08-07 00:03:08 +00:00
xpi_path: ${{ env.PKG }}
src_path: ${{ env.PKG_SRC }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled && failure() }}
with:
limit-access-to-actor: true