-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cyclinder/ci1
fix ci1
- Loading branch information
Showing
1 changed file
with
43 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ on: | |
push: | ||
branch: | ||
tags: | ||
- main | ||
- main | ||
|
||
permissions: write-all | ||
|
||
|
@@ -32,52 +32,49 @@ jobs: | |
name: Binary Build ${{ matrix.go_arch }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get Upload | ||
id: tag | ||
run: | | ||
if ${{ inputs.ref != '' }} ; then | ||
echo "call by workflow_call" | ||
echo "upload=true" >> $GITHUB_OUTPUT | ||
echo "tag=${{ inputs.ref }}" >> $GITHUB_OUTPUT | ||
elif ${{ inputs.tag != '' }} ; then | ||
echo "call by workflow_call(release push)" | ||
echo "upload=true" >> $GITHUB_OUTPUT | ||
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | ||
elif ${{ github.event_name == 'push' }} ; then | ||
echo "trigger by push" | ||
echo "upload=false" >> $GITHUB_OUTPUT | ||
echo "tag=main" >> $GITHUB_OUTPUT | ||
elif ${{ github.event_name == 'pull_request_target' }} ; then | ||
echo "trigger by pull_request_target" | ||
echo "upload=false" >> $GITHUB_OUTPUT | ||
echo "tag=dev" >> $GITHUB_OUTPUT | ||
else | ||
echo "unexpected event: ${{ github.event_name }}" | ||
exit 1 | ||
fi | ||
- name: Get Upload | ||
id: tag | ||
run: | | ||
if ${{ inputs.ref != '' }} ; then | ||
echo "call by workflow_call(e2e)" | ||
echo "upload=true" >> $GITHUB_OUTPUT | ||
echo "tag=dev" >> $GITHUB_OUTPUT | ||
elif ${{ inputs.tag != '' }} ; then | ||
echo "call by workflow_call(release push)" | ||
echo "upload=true" >> $GITHUB_OUTPUT | ||
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | ||
elif ${{ github.event_name == 'push' }} ; then | ||
echo "trigger by push" | ||
echo "upload=false" >> $GITHUB_OUTPUT | ||
echo "tag=main" >> $GITHUB_OUTPUT | ||
elif ${{ github.event_name == 'pull_request_target' }} ; then | ||
echo "trigger by pull_request_target" | ||
echo "upload=false" >> $GITHUB_OUTPUT | ||
echo "tag=dev" >> $GITHUB_OUTPUT | ||
else | ||
echo "unexpected event: ${{ github.event_name }}" | ||
exit 1 | ||
fi | ||
- name: Build | ||
run: make build ARCH=${{ matrix.go_arch }} GIT_TAG=${{ steps.tag.outputs.tag }} | ||
- name: Build | ||
run: | ||
make build ARCH=${{ matrix.go_arch }} GIT_TAG=${{ steps.tag.outputs.tag }} | ||
if [ "${{ steps.tag.outputs.upload }}" == "true" ]; then | ||
cd ./.tmp/bin && tar -cvzf /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar * | ||
fi | ||
|
||
- name: Tar Binary Files | ||
if: ${{ steps.tag.outputs.upload == 'true' }} | ||
run: | | ||
sudo mkdir -p /home/plugins | ||
sudo cd ./.tmp/bin | ||
sudo tar -cvzf /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar * | ||
- name: Upload Binary artifact | ||
if: ${{ steps.tag.outputs.upload == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: binary_files | ||
path: /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar | ||
retention-days: 1 | ||
- name: Upload Binary artifact | ||
if: ${{ steps.tag.outputs.upload == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
name: binary_files | ||
path: /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar | ||
retention-days: 1 |