Update versioning #11
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
name: Build Fastboot Flasher | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Git | |
run: git config --global --add safe.directory /github/workspace | |
- name: Get current date and commit hash | |
id: version | |
run: | | |
DATE=$(date +'%Y%m%d') | |
VERSION="v3-${DATE}" | |
echo "::set-output name=version::$VERSION" | |
- name: Set Git user info | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Jefino9488" | |
- name: Download latest Linux platform tools | |
run: | | |
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip -O platform-tools-linux.zip | |
mkdir -p tools/linux | |
unzip platform-tools-linux.zip -d tools/linux | |
- name: Download latest Windows platform tools | |
run: | | |
wget https://dl.google.com/android/repository/platform-tools-latest-windows.zip -O platform-tools-windows.zip | |
mkdir -p tools/windows | |
unzip platform-tools-windows.zip -d tools/windows | |
- name: Create images directory | |
run: mkdir -p images | |
- name: Prepare files for zip | |
run: | | |
mkdir -p fastbootflasher-v2 | |
cp -r tools fastbootflasher-v2/tools | |
cp -r images fastbootflasher-v2/images | |
cp installer.bat fastbootflasher-v2/ | |
- name: Create zip file | |
run: | | |
zip -r fastbootflasher-${{ steps.version.outputs.version }}.zip fastbootflasher-v2 | |
- name: Create Release Notes | |
run: | | |
touch release_notes.txt | |
echo "## Release Notes" > release_notes.txt | |
echo "- Built Fastboot Flasher from commit ${{ github.sha }}" >> release_notes.txt | |
echo "- Version: ${{ steps.version.outputs.version }}" >> release_notes.txt | |
- name: Create release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: fastbootflasher-${{ steps.version.outputs.version }}.zip | |
tag: "${{ steps.version.outputs.version }}" | |
name: "Fastboot Flasher ${{ steps.version.outputs.version }}" | |
allowUpdates: true | |
makeLatest: true | |
bodyFile: release_notes.txt | |
token: ${{ secrets.GITHUB_TOKEN }} |