Skip to content

Commit 139ff72

Browse files
author
Aaron Roller
authored
Merge pull request #33 from AutoModality/AM-278/cont-deploy
docs: updated readme AM-278/cont-deploy
2 parents 218c0c1 + 604089b commit 139ff72

File tree

4 files changed

+82
-41
lines changed

4 files changed

+82
-41
lines changed

.github/workflows/package.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
name: Release Candidate
22
on:
3-
pull_request:
4-
branches:
3+
push:
4+
branches-ignore:
55
- master
66
jobs:
77
package:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os: [ubuntu-18.04, [self-hosted,linux,arm64]]
11+
os: [[x64, self-hosted,linux], [arm64,self-hosted,linux]]
1212
fail-fast: false
1313
steps:
14-
- uses: AutoModality/action-clean@v1
14+
- uses: AutoModality/action-clean@v1.1.0
1515
- uses: actions/checkout@v2
16+
- uses: rlespinasse/github-slug-action@2.0.0 # for GITHUB_REF_SLUG
1617
- name: Package
1718
id: package
18-
uses: AutoModality/action-package-debian-ros@v3-perception
19+
uses: AutoModality/action-package-debian-ros@v3.2.0
1920
with:
20-
branch: ${{ github.event.pull_request.head.ref }}
21+
branch: ${{ env.GITHUB_REF_SLUG }}
2122
build-number: ${{ github.run_number }}
2223
release-repo-entitlement: ${{ secrets.CLOUDSMITH_READ_RELEASE_ENTITLEMENT }}
2324
- name: The generated package
@@ -34,3 +35,22 @@ jobs:
3435
distro: 'ubuntu'
3536
release: 'bionic'
3637
file: '${{ steps.package.outputs.artifact-path }}'
38+
draft-pr:
39+
runs-on: ubuntu-18.04
40+
needs: package
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: Draft a Pull Request
44+
uses: repo-sync/pull-request@v2
45+
with:
46+
pr_draft: true
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
# code-format:
49+
# runs-on: ubuntu-18.04
50+
# needs: package
51+
# steps:
52+
# - uses: actions/checkout@v2
53+
# - name: Format Code
54+
# uses: AutoModality/action-ros-clang-format@master
55+
# env:
56+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ on:
33
push:
44
branches:
55
- master
6+
env:
7+
RELEASE_DIR: release
8+
RELEASE_PROPERTIES_FILE: release/release.properties
9+
RELEASE_PAYLOAD_FILE: release/payload.json
610
jobs:
711
release:
8-
runs-on: ubuntu-18.04
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [[x64,self-hosted,linux]]
916
steps:
17+
- uses: AutoModality/action-clean@v1.1.0
1018
- name: Checkout
1119
uses: actions/checkout@v2
1220
- name: Semantic Release
@@ -15,57 +23,64 @@ jobs:
1523
env:
1624
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1725
- name: Write release result to file
18-
run: mkdir release
26+
run: mkdir ${{ env.RELEASE_DIR }}
1927
- name: Write Published
2028
uses: christian-draeger/write-properties@1.0.1
2129
with:
22-
path: 'release.properties'
30+
path: ${{ env.RELEASE_PROPERTIES_FILE }}
2331
property: 'published'
2432
value: ${{ steps.semantic.outputs.new_release_published }}
2533
- name: Write Version
2634
uses: christian-draeger/write-properties@1.0.1
2735
if: steps.semantic.outputs.new_release_published == 'true'
2836
with:
29-
path: 'release.properties'
37+
path: ${{ env.RELEASE_PROPERTIES_FILE }}
3038
property: 'version'
3139
value: ${{ steps.semantic.outputs.new_release_version }}
40+
- name: Write Release Payload
41+
run: |
42+
#retrieve package name from changelog guaranteed to be first characters ( split on space, choose first result)
43+
package_name=$(head -1 debian/changelog | awk -F' ' '{print $1}')
44+
echo "{\"package\":\"${package_name}\", \"new_release_version\": \"${{ steps.semantic.outputs.new_release_version }}\", \"new_release_major_version\": \"${{ steps.semantic.outputs.new_release_major_version }}\", \"new_release_minor_version\":\"${{ steps.semantic.outputs.new_release_minor_version }}\",\"new_release_patch_version\":\"${{ steps.semantic.outputs.new_release_patch_version }}\"}" > ${{ env.RELEASE_PAYLOAD_FILE }}
3245
- name: Share release file with other jobs
3346
uses: actions/upload-artifact@v1
3447
with:
3548
name: release
36-
path: 'release.properties'
49+
path: '${{ env.RELEASE_DIR }}'
3750
release-package:
51+
needs: release
3852
runs-on: ${{ matrix.os }}
3953
strategy:
4054
matrix:
41-
os: [ubuntu-18.04, [self-hosted,linux,arm64]]
42-
needs: release
55+
os: [[x64,self-hosted,linux], [arm64,self-hosted,linux]]
56+
fail-fast: true
4357
name: Package if released
4458
steps:
45-
- uses: AutoModality/action-clean@v1
59+
- uses: AutoModality/action-clean@v1.1.0
4660
- name: Checkout
4761
uses: actions/checkout@v2
4862
- name: Download release
4963
uses: actions/download-artifact@v1
5064
with:
5165
name: release
66+
path: ${{ env.RELEASE_DIR }}
5267
- name: Read Published
5368
id: published
5469
uses: christian-draeger/read-properties@1.0.1
5570
with:
56-
path: 'release/release.properties'
71+
path: ${{ env.RELEASE_PROPERTIES_FILE }}
5772
property: 'published'
5873
- name: Read Version if published
5974
id: version
6075
if: steps.published.outputs.value == 'true'
6176
uses: christian-draeger/read-properties@1.0.1
6277
with:
63-
path: 'release/release.properties'
78+
path: ${{ env.RELEASE_PROPERTIES_FILE }}
6479
property: 'version'
6580
- name: Package if published
6681
if: steps.published.outputs.value == 'true'
6782
id: package
68-
uses: AutoModality/action-package-debian-ros@v3-perception
83+
uses: AutoModality/action-package-debian-ros@v3.2.0
6984
with:
7085
version: ${{ steps.version.outputs.value }}
7186
release-repo-entitlement: ${{ secrets.CLOUDSMITH_READ_RELEASE_ENTITLEMENT }}
@@ -82,3 +97,32 @@ jobs:
8297
distro: 'ubuntu'
8398
release: 'bionic'
8499
file: '${{ steps.package.outputs.artifact-path }}'
100+
notify-amros:
101+
needs: release-package
102+
runs-on: ubuntu-latest
103+
name: Notify AMROS
104+
steps:
105+
- name: Download release
106+
uses: actions/download-artifact@v1
107+
with:
108+
name: release
109+
path: ${{ env.RELEASE_DIR }}
110+
- name: Read Published
111+
id: published
112+
uses: christian-draeger/read-properties@1.0.1
113+
with:
114+
path: ${{ env.RELEASE_PROPERTIES_FILE }}
115+
property: 'published'
116+
- name: Payload env
117+
run: |
118+
payload=$(cat ${{ env.RELEASE_PAYLOAD_FILE }} )
119+
echo ::set-env name=RELEASE_PAYLOAD::$payload
120+
- name: Notify AMROS of Release
121+
if: steps.published.outputs.value == 'true'
122+
uses: peter-evans/repository-dispatch@v1
123+
with:
124+
token: ${{ secrets.AMGITBOT_PAT }}
125+
repository: AutoModality/amros
126+
event-type: package-released
127+
client-payload: "${{ env.RELEASE_PAYLOAD }}"
128+

.github/workflows/story.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
A common library for sharing core code.
44

5-
| Github Action | Melodic Package |
6-
| ------------- | ------------- |
7-
| [![Story Development](https://github.com/AutoModality/am-utils/workflows/Story%20Development/badge.svg)](https://github.com/AutoModality/am-utils/actions?query=workflow%3A%22Story+Development%22) | -- |
8-
| [![Release Candidate](https://github.com/AutoModality/am-utils/workflows/Release%20Candidate/badge.svg)](https://github.com/AutoModality/am-utils/actions?query=workflow%3A%22Release+Candidate%22) | [![Latest Version @ Cloudsmith](https://api-prd.cloudsmith.io/badges/version/automodality/dev/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/?render=true&badge_token=gAAAAABeQHmJfRp7kwNLZ6HV9cXQCLx1oKm3MYDqMPtuUyZunep6ZjusRn_67muio5lDbumO-eW9_KvmoflqrAFGV-7LocdY0WJJ7UuRL9wa9nPzkYiHuxA%3D)](https://cloudsmith.io/~automodality/repos/dev/packages/detail/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/) |
9-
| [![Release](https://github.com/AutoModality/am-utils/workflows/Release/badge.svg)](https://github.com/AutoModality/am-utils/actions?query=workflow%3A%22Release) | [![Latest Version @ Cloudsmith](https://api-prd.cloudsmith.io/badges/version/automodality/release/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/?render=true&badge_token=gAAAAABeqLhgdWIjHJx-ECHaOOt63ddd3Zk8RY8uuA1ud-F6ccjttvsL0CWuVcnFwVRpx2OP1WB0FuGs2qIFFcXc8BK7dOg0gSIK8MeMoLhlZs1EfIuPATo%3D)](https://cloudsmith.io/~automodality/repos/release/packages/detail/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/) |
5+
[![Release](https://github.com/AutoModality/am-utils/workflows/Release/badge.svg)](https://github.com/AutoModality/am-utils/actions?query=workflow%3A%22Release) [![Latest Version @ Cloudsmith](https://api-prd.cloudsmith.io/badges/version/automodality/release/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/?render=true&badge_token=gAAAAABeqLhgdWIjHJx-ECHaOOt63ddd3Zk8RY8uuA1ud-F6ccjttvsL0CWuVcnFwVRpx2OP1WB0FuGs2qIFFcXc8BK7dOg0gSIK8MeMoLhlZs1EfIuPATo%3D)](https://cloudsmith.io/~automodality/repos/release/packages/detail/deb/ros-melodic-am-utils/latest/d=ubuntu%252Fbionic;t=1/)
106

117
## Run in Docker
128

0 commit comments

Comments
 (0)