-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (50 loc) · 1.94 KB
/
CI.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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Tag name
id: tag
run: echo "::set-output name=tag::${{ github.event.release.name }}"
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${{ github.event.release.target_commitish }})"
id: extract_branch
- name: Checkout Repo
uses: actions/checkout@v3
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push
run: |
git pull origin ${{ steps.extract_branch.outputs.branch }}
git checkout ${{ steps.extract_branch.outputs.branch }}
sed -i "/__version__ =/c\__version__ = '${{ steps.tag.outputs.tag }}'" pyicub/__init__.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit Files
run: |
git config --global user.name 'S4HRI bot'
git config --global user.email '[email protected]'
git diff --exit-code || git commit -m "Auto versioning" -a
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}
force: true