Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
eeliu committed Oct 11, 2024
1 parent a80e960 commit 0ee3062
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/publish-collector-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: publish-collector-agent
on:
release:
types: [created]
workflow_dispatch:

permissions:
contents: write
packages: write

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}/collector-agent
TAG_NAME: ${{ github.head_ref || github.ref_name }}
TAG_NAME: 0.7

jobs:
collector-agent:
Expand Down Expand Up @@ -58,9 +59,6 @@ jobs:
with:
context: collector-agent
platforms: ${{ matrix.platform }}
# tags: |
# ghcr.io/${{ github.repository }}/collector-agent:${{ inputs.tag }}
# ghcr.io/${{ github.repository }}/collector-agent:latest
github-token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
Expand Down Expand Up @@ -115,10 +113,11 @@ jobs:
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ env.TAG_NAME }}
Release-Collector-agent:
runs-on: ubuntu-latest
if: github.event_name == 'release'
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
Expand All @@ -132,7 +131,7 @@ jobs:
id: release-ca
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goversion: "https://dl.google.com/go/go1.18.10.linux-amd64.tar.gz"
goversion: 1.19
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "collector-agent"
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: release php package
on:
push:
tags:
- "v*.*.*"
- "v*.*"
workflow_dispatch:


env:
MODULE_PAK: pinpoint_php@${{ github.head_ref || github.ref_name }}
Expand All @@ -21,7 +23,7 @@ jobs:
md5=($(md5sum ${{ env.MODULE_PAK }} ))
PACK_NAME=${{ env.MODULE_PAK }}-${md5}-$(date '+%Y-%m-%d').tar.gz
mv ${{ env.MODULE_PAK }} $PACK_NAME
echo "PACK=$PACK_NAME" >> $GITHUB_OUTPUT
echo "PACK=$PACK_NAME" >> $GITHUB_OUTPUT
- name: Release php_package
id: rel_php_pak
uses: softprops/action-gh-release@v2
Expand All @@ -39,4 +41,14 @@ jobs:
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: install_pinpoint_php.sh
files: install_pinpoint_php.sh

- name: pack pinpoint-common
run: |
tar zcvf pinpoint-common.tar.gz common
- name: Release pinpoint-common
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: pinpoint-common.tar.gz

0 comments on commit 0ee3062

Please sign in to comment.