|
1 | | -# This is a basic workflow to help you get started with Actions |
2 | | - |
3 | 1 | name: CI |
4 | 2 |
|
5 | | -# Controls when the workflow will run |
6 | 3 | on: |
7 | | - # Triggers the workflow on push or pull request events but only for the "master" branch |
8 | | - push: |
9 | | - branches: [ "master" ] |
10 | 4 | pull_request: |
11 | | - branches: [ "master" ] |
12 | | - |
13 | | - # Allows you to run this workflow manually from the Actions tab |
| 5 | + branches: ["master"] |
| 6 | + push: |
| 7 | + branches: ["master"] |
14 | 8 | workflow_dispatch: |
15 | 9 |
|
16 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 10 | +permissions: |
| 11 | + contents: write |
| 12 | + |
17 | 13 | jobs: |
18 | | - # This workflow contains a single job called "build" |
19 | 14 | build: |
20 | | - # The type of runner that the job will run on |
21 | 15 | runs-on: ubuntu-latest |
22 | 16 |
|
23 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
24 | 17 | steps: |
25 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
26 | | - - uses: actions/checkout@v3 |
| 18 | + - uses: actions/checkout@v4 |
27 | 19 |
|
28 | | - # Runs a single command using the runners shell |
29 | | - - name: Run a one-line script |
| 20 | + - name: Build skins |
30 | 21 | run: ./build_skins.sh |
31 | 22 |
|
32 | | - - name: 'Upload Artifact' |
33 | | - uses: actions/upload-artifact@v3 |
| 23 | + release: |
| 24 | + if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 25 | + needs: build |
| 26 | + runs-on: ubuntu-latest |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Create OTA release archive |
| 32 | + run: | |
| 33 | + mkdir -p dist |
| 34 | + cd OTA |
| 35 | + find . -type f ! -path './.*' ! -path '*/.*' -print0 \ |
| 36 | + | sort -z \ |
| 37 | + | tar --null -czf "../dist/ota-${GITHUB_SHA}.tar.gz" --files-from - |
| 38 | +
|
| 39 | + - name: Publish release |
| 40 | + uses: softprops/action-gh-release@v2 |
34 | 41 | with: |
35 | | - name: SamsungGalaxyS7.skin |
36 | | - path: OTA/SamsungGalaxyS7.skin |
37 | | - retention-days: 5 |
| 42 | + tag_name: ota-${{ github.sha }} |
| 43 | + name: OTA Release ${{ github.sha }} |
| 44 | + generate_release_notes: true |
| 45 | + files: dist/ota-${{ github.sha }}.tar.gz |
0 commit comments