Update latest.json and current_version.txt #18
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
# 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 latest.json and current_version.txt | |
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 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Git config | |
run: | | |
git config --global user.name "Ryosuke Asano" | |
git config --global user.email "[email protected]" | |
- name: get current version | |
run: | | |
echo "Getting current version" | |
export CURRENT_VERSION=`cat ./current_version.txt` | |
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV | |
- name: Update latest.json | |
run: | | |
echo "Updating latest.json" | |
echo "new version: ${{ github.event.inputs.display-version }}" | |
echo "current version: ${{ env.CURRENT_VERSION }}" | |
sed -i 's/${{ env.CURRENT_VERSION }}/${{ github.event.inputs.display-version }}/g' browser/latest.json | |
sed -i 's/${{ env.CURRENT_VERSION }}/${{ github.event.inputs.display-version }}/g' browser-portable/latest.json | |
- name: Update current_version.txt | |
run: | | |
echo "Updating current_version.txt" | |
echo "${{ github.event.inputs.display-version }}" > current_version.txt | |
- name: Commit | |
run: | | |
git add . | |
git commit -m "Update latest.json and current_version.txt" | |
git push |