forked from Pi4J/pi4j-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.91 KB
/
ci-develop-snapshot.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
name: Build develop snapshot and push to download repo
on:
push:
branches: [ develop ]
workflow_dispatch:
jobs:
Build:
name: Build & Deploy Snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get latest Docker image
run: docker pull pi4j/pi4j-builder:2.0
- name: Build entire Pi4J Project in Docker
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: docker run --env MAVEN_USERNAME=$MAVEN_USERNAME --env MAVEN_PASSWORD=$MAVEN_PASSWORD --user "$(id -u):$(id -g)" --rm --volume $(pwd):/build pi4j/pi4j-builder:2.0 clean deploy -Pnative,cross-compile --batch-mode
- name: Make staging directory
run: mkdir staging
- name: Copy distribution files to staging
run: |
cp -r pi4j-distribution/target/*.deb staging
cp -r pi4j-distribution/target/*.zip staging
- name: Upload distribution files to staging
uses: actions/upload-artifact@v2
with:
name: pi4j-v2-dist
path: staging
DeployPackages:
name: Deploy to APT/Download Repo
needs: [Build]
runs-on: ubuntu-latest
environment:
name: Staging
url: 'https://github.com/Pi4J/download'
steps:
- name: Download staged artifacts from build
uses: actions/download-artifact@v2
with:
name: pi4j-v2-dist
- name: Display downloaded build artifacts
shell: bash
run: tree
- name: Publish build packages to APT download repository
uses: dmnemec/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'pi4j-*.*'
destination_repo: 'pi4j/download'
destination_branch: 'main'
user_email: '[email protected]'
user_name: 'Pi4J Build'