Skip to content

Update Floorp-Portable version #18

Update Floorp-Portable version

Update Floorp-Portable version #18

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
name: Update Floorp-Portable version
on:
workflow_dispatch:
inputs:
display-version:
description: 'Display version of the update'
required: true
type: string
jobs:
update-latest-json:
runs-on: ubuntu-latest
steps:
- name: Details
run: |
echo "Display version: ${{ github.event.inputs.display-version }}"
- name: Checkout
uses: actions/checkout@v2
- name: Git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Get download url
run: |
export WIN_X86_64_DOWNLOAD_URL="https://github.com/Floorp-Projects/Floorp-Portable/releases/download/${{ github.event.inputs.display-version }}-portable/floorp-${{ github.event.inputs.display-version }}-portable-windows-x86_64.zip"
export LINUX_X86_64_DOWNLOAD_URL="https://github.com/Floorp-Projects/Floorp-Portable/releases/download/${{ github.event.inputs.display-version }}-portable/floorp-${{ github.event.inputs.display-version }}-portable-linux-x86_64.tar.zst"
export LINUX_AARCH64_DOWNLOAD_URL="https://github.com/Floorp-Projects/Floorp-Portable/releases/download/${{ github.event.inputs.display-version }}-portable/floorp-${{ github.event.inputs.display-version }}-portable-linux-aarch64.tar.zst"
echo "WIN_X86_64_DOWNLOAD_URL=$WIN_X86_64_DOWNLOAD_URL" >> $GITHUB_ENV
echo "LINUX_X86_64_DOWNLOAD_URL=$LINUX_X86_64_DOWNLOAD_URL" >> $GITHUB_ENV
echo "LINUX_AARCH64_DOWNLOAD_URL=$LINUX_AARCH64_DOWNLOAD_URL" >> $GITHUB_ENV
- name: Get sha256 hash
run: |
curl -f -L -o win-x86-64 "${{ env.WIN_X86_64_DOWNLOAD_URL }}"
curl -f -L -o linux-x86-64 "${{ env.LINUX_X86_64_DOWNLOAD_URL }}"
curl -f -L -o linux-aarch64 "${{ env.LINUX_AARCH64_DOWNLOAD_URL }}"
export WIN_X86_64_SHA256=`cat win-x86-64 | sha256sum | awk '{print $1}'`
export LINUX_X86_64_SHA256=`cat linux-x86-64 | sha256sum | awk '{print $1}'`
export LINUX_AARCH64_SHA256=`cat linux-aarch64 | sha256sum | awk '{print $1}'`
echo "WIN_X86_64_SHA256=$WIN_X86_64_SHA256" >> $GITHUB_ENV
echo "LINUX_X86_64_SHA256=$LINUX_X86_64_SHA256" >> $GITHUB_ENV
echo "LINUX_AARCH64_SHA256=$LINUX_AARCH64_SHA256" >> $GITHUB_ENV
rm win-x86-64
rm linux-x86-64
rm linux-aarch64
- name: Set win-x86-64 version
run: |
cd ./browser-portable
jq '."win-x86-64".version|="${{ github.event.inputs.display-version }}"' ./latest.json | tee ./latest.json
jq '."win-x86-64".url|="${{ env.WIN_X86_64_DOWNLOAD_URL }}"' ./latest.json | tee ./latest.json
jq '."win-x86-64".sha256|="${{ env.WIN_X86_64_SHA256 }}"' ./latest.json | tee ./latest.json
- name: Set linux-x86-64 version
run: |
cd ./browser-portable
jq '."linux-x86-64".version|="${{ github.event.inputs.display-version }}"' ./latest.json | tee ./latest.json
jq '."linux-x86-64".url|="${{ env.LINUX_X86_64_DOWNLOAD_URL }}"' ./latest.json | tee ./latest.json
jq '."linux-x86-64".sha256|="${{ env.LINUX_X86_64_SHA256 }}"' ./latest.json | tee ./latest.json
- name: Set linux-aarch64 version
run: |
cd ./browser-portable
# Why "arm"?, see: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/PlatformArch
jq '."linux-arm".version|="${{ github.event.inputs.display-version }}"' ./latest.json | tee ./latest.json
jq '."linux-arm".url|="${{ env.LINUX_AARCH64_DOWNLOAD_URL }}"' ./latest.json | tee ./latest.json
jq '."linux-arm".sha256|="${{ env.LINUX_AARCH64_SHA256 }}"' ./latest.json | tee ./latest.json
- name: Commit
run: |
git add ./browser-portable/latest.json
git commit -m "Update Floorp Portable version"
git push
- name: Waiting 5 seconds...
run: |
sleep 5
# upload:
# needs: ["update-latest-json"]
# uses: ./.github/workflows/upload.yml
# secrets:
# FTP_ADDR: ${{ secrets.FTP_ADDR }}
# FTP_USER: ${{ secrets.FTP_USER }}
# FTP_PASS: ${{ secrets.FTP_PASS }}