-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (64 loc) · 2.3 KB
/
Build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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 }}