Skip to content

fix: 修正更新链接 #58

fix: 修正更新链接

fix: 修正更新链接 #58

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
tags:
- "v*"
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest
if: contains(github.ref, 'tags')
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Setup autoit environment
- uses: liudonghua123/action-setup-autoit@main
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#*\/v}
shell: bash
# Force to update the version number if I forgot to update it
- name: Update the version.
shell: bash
run: |
sed -i "s/#AutoIt3Wrapper_Res_Fileversion.*/#AutoIt3Wrapper_Res_Fileversion=${{ steps.get_version.outputs.VERSION }}.0/" RunFirefox.au3
sed -i "s/Global Const \$AppVersion.*/Global Const \$AppVersion = \"${{ steps.get_version.outputs.VERSION }}\"/" RunFirefox.au3
# Duplicate script for other icons
- name: Duplicate scripts
shell: bash
run: |
cp RunFirefox.au3 FireDoge.au3
cp RunFirefox.au3 RunFloorp.au3
sed -i "s/Firefox.ico/FireDoge.ico/" FireDoge.au3
sed -i "s/Global Const \$CustomArch.*/Global Const \$CustomArch = \"FireDoge\"/" FireDoge.au3
sed -i "s/RunFirefox.exe/FireDoge.exe/" FireDoge.au3
sed -i "s/RunFirefox_x64.exe/FireDoge_x64.exe/" FireDoge.au3
sed -i "s/Firefox.ico/Floorp.ico/" RunFloorp.au3
sed -i "s/Global Const \$CustomArch.*/Global Const \$CustomArch = \"RunFloorp\"/" RunFloorp.au3
sed -i "s/RunFirefox.exe/RunFloorp.exe/" RunFloorp.au3
sed -i "s/RunFirefox_x64.exe/RunFloorp_x64.exe/" RunFloorp.au3
# Runs build
- name: Build scripts
shell: cmd
run: |
"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /in RunFirefox.au3 /NoStatus
"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /in FireDoge.au3 /NoStatus
"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /in RunFloorp.au3 /NoStatus
# Check the output
- name: Check the output
shell: bash
run: |
ls -l
# Package the binaries
- name: Package the binaries
shell: bash
run: |
7z a -tzip RunFirefox_${{ steps.get_version.outputs.VERSION }}.zip RunFirefox.exe
7z a -tzip RunFirefox_${{ steps.get_version.outputs.VERSION }}_x64.zip RunFirefox_x64.exe
7z a -tzip FireDoge_${{ steps.get_version.outputs.VERSION }}.zip FireDoge.exe
7z a -tzip FireDoge_${{ steps.get_version.outputs.VERSION }}_x64.zip FireDoge_x64.exe
7z a -tzip RunFloorp_${{ steps.get_version.outputs.VERSION }}.zip RunFloorp.exe
7z a -tzip RunFloorp_${{ steps.get_version.outputs.VERSION }}_x64.zip RunFloorp_x64.exe
# Deploy to the github release
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.zip"
tags: true
draft: false
overwrite: true
# Update version
- name: Change version information in Update.txt
run: |
rm Update.txt
rm Update_FireDoge.txt
rm Update_RunFloorp.txt
cp Update_Template.txt Update_RunFirefox.txt
cp Update_Template.txt Update_FireDoge.txt
cp Update_Template.txt Update_RunFloorp.txt
sed -i "s/EXE_VERSION/${{ steps.get_version.outputs.VERSION }}/g" Update_RunFirefox.txt
sed -i "s/EXE_MESSAGE/${{ github.event.head_commit.message }}/g" Update_RunFirefox.txt
sed -i "s/EXE_VERSION/${{ steps.get_version.outputs.VERSION }}/g" Update_FireDoge.txt
sed -i "s/EXE_MESSAGE/${{ github.event.head_commit.message }}/g" Update_FireDoge.txt
sed -i "s/RunFirefox_/FireDoge_/g" Update_FireDoge.txt
sed -i "s/EXE_VERSION/${{ steps.get_version.outputs.VERSION }}/g" Update_RunFloorp.txt
sed -i "s/EXE_MESSAGE/${{ github.event.head_commit.message }}/g" Update_RunFloorp.txt
sed -i "s/RunFirefox_/RunFloorp_/g" Update_RunFloorp.txt
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
push: origin HEAD:master
add: "*.txt RunFirefox.au3"
fetch: true
message: "Bump update information"