Skip to content

Commit

Permalink
Update ci.yml and release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed Sep 26, 2023
1 parent e8c4719 commit 2780888
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 55 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
name: CI

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
release:
types: [published]
schedule:
- cron: "0 6 * * 1-5"
- cron: "0 1 * * 1-5"
workflow_dispatch:


jobs:
check:
Expand Down
101 changes: 51 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
name: Release

on:
release:
types: [published]
push:
branches: ["**"]
pull_request:
branches: ["**"]
schedule:
- cron: "0 1 * * 1-5"
workflow_dispatch:
- cron: "0 6 * * 1-5"

jobs:
checks:
Expand Down Expand Up @@ -261,55 +262,55 @@ jobs:
${{ steps.package.outputs.BIN_PKG_NAME }}
${{ steps.package.outputs.DEBS_PKG_NAME }}
# docker-build:
# name: Docker build and push
# needs: [checks, builds]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 500 # NOTE: get long history for git-version crate to correctly compute a version
# submodules: recursive
# - name: Fetch Git tags # NOTE: workaround for https://github.com/actions/checkout/issues/290
# shell: bash
# run: git fetch --tags --force
# - name: Download packages from previous job
# uses: actions/download-artifact@v2
# with:
# path: PACKAGES
# - name: Unzip PACKAGES
# run: |
# ls PACKAGES
# mkdir -p docker/linux/amd
# unzip PACKAGES/x86_64-unknown-linux-musl/zenoh-bridge-ros1-${{ needs.checks.outputs.PKG_VERSION }}-x86_64-unknown-linux-musl.zip -d docker/linux/amd64/
# mkdir -p docker/linux/arm64
# unzip PACKAGES/aarch64-unknown-linux-musl/zenoh-bridge-ros1-${{ needs.checks.outputs.PKG_VERSION }}-aarch64-unknown-linux-musl.zip -d docker/linux/arm64/
# tree docker
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Docker meta - set tags and labels
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: eclipse/zenoh-bridge-ros1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_COM_USERNAME }}
# password: ${{ secrets.DOCKER_COM_PASSWORD }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# platforms: linux/amd64,linux/arm64
# file: .github/workflows/Dockerfile
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
docker-build:
name: Docker build and push
needs: [checks, builds]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 500 # NOTE: get long history for git-version crate to correctly compute a version
submodules: recursive
- name: Fetch Git tags # NOTE: workaround for https://github.com/actions/checkout/issues/290
shell: bash
run: git fetch --tags --force
- name: Download packages from previous job
uses: actions/download-artifact@v2
with:
path: PACKAGES
- name: Unzip PACKAGES
run: |
ls PACKAGES
mkdir -p docker/linux/amd
unzip PACKAGES/x86_64-unknown-linux-musl/zenoh-bridge-ros1-${{ needs.checks.outputs.PKG_VERSION }}-x86_64-unknown-linux-musl.zip -d docker/linux/amd64/
mkdir -p docker/linux/arm64
unzip PACKAGES/aarch64-unknown-linux-musl/zenoh-bridge-ros1-${{ needs.checks.outputs.PKG_VERSION }}-aarch64-unknown-linux-musl.zip -d docker/linux/arm64/
tree docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta - set tags and labels
id: meta
uses: docker/metadata-action@v3
with:
images: eclipse/zenoh-bridge-ros1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_COM_USERNAME }}
password: ${{ secrets.DOCKER_COM_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
file: .github/workflows/Dockerfile
push: false # true todo: temporary disabled
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

publication:
name: Release publication
if: needs.checks.outputs.IS_RELEASE == 'true'
if: false # needs.checks.outputs.IS_RELEASE == 'true' todo: temporary disabled
needs: [checks, builds]
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 2780888

Please sign in to comment.