Skip to content

Commit

Permalink
chore: Fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: MeihaoZuyu <[email protected]>
  • Loading branch information
MeihaoZuyu authored and archidoge0 committed May 10, 2024
1 parent 50c57bb commit 98cca12
Showing 1 changed file with 60 additions and 85 deletions.
145 changes: 60 additions & 85 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -2,104 +2,79 @@ name: Build and Release

on:
release:
types: [published]
types:
- published

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Build for Linux
run: |
GOOS=linux GOARCH=amd64 go build -o modular-indexer-light .
zip modular-indexer-light-linux-amd64.zip config.example.json modular-indexer-light run.sh
- name: Build for Linux
run: |
make GOOS=linux GOARCH=amd64
zip modular-indexer-light-linux-amd64.zip config.example.json modular-indexer-light run.sh
- name: Build for macOS amd64
run: |
GOOS=darwin GOARCH=amd64 go build -o modular-indexer-light .
zip modular-indexer-light-darwin-amd64.zip config.example.json modular-indexer-light run.sh
- name: Build for macOS amd64
run: |
make GOOS=darwin GOARCH=amd64
zip modular-indexer-light-darwin-amd64.zip config.example.json modular-indexer-light run.sh
- name: Build for macOS arm64
run: |
GOOS=darwin GOARCH=arm64 go build -o modular-indexer-light .
zip modular-indexer-light-darwin-arm64.zip config.example.json modular-indexer-light run.sh
- name: Build for macOS arm64
run: |
make GOOS=darwin GOARCH=arm64
zip modular-indexer-light-darwin-arm64.zip config.example.json modular-indexer-light run.sh
- name: Build for Windows
run: |
GOOS=windows GOARCH=amd64 go build -o modular-indexer-light.exe .
zip modular-indexer-light-windows-amd64.zip config.example.json modular-indexer-light.exe run.bat
- name: Build for Windows
run: |
make GOOS=windows GOARCH=amd64
zip modular-indexer-light-windows-amd64.zip config.example.json modular-indexer-light.exe run.bat
# - name: Release
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# prerelease: false
# make_latest: "true"
# generate_release_notes: true
# files: |
# light-indexer-linux-amd64.zip
# light-indexer-darwin-amd64.zip
# light-indexer-windows-amd64.zip
- name: Upload Release Assets linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-linux-amd64.zip
asset_name: modular-indexer-light-linux-amd64.zip
asset_content_type: application/zip

# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this release:
# - Describe your changes here
# draft: false
# prerelease: false
- name: Upload Release Assets darwin amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-darwin-amd64.zip
asset_name: modular-indexer-light-darwin-amd64.zip
asset_content_type: application/zip

- name: Upload Release Assets linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-linux-amd64.zip
asset_name: modular-indexer-light-linux-amd64.zip
asset_content_type: application/zip

- name: Upload Release Assets darwin amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-darwin-amd64.zip
asset_name: modular-indexer-light-darwin-amd64.zip
asset_content_type: application/zip
- name: Upload Release Assets darwin arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-darwin-arm64.zip
asset_name: modular-indexer-light-darwin-arm64.zip
asset_content_type: application/zip

- name: Upload Release Assets darwin arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-darwin-arm64.zip
asset_name: modular-indexer-light-darwin-arm64.zip
asset_content_type: application/zip

- name: Upload Release Assets windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-windows-amd64.zip
asset_name: modular-indexer-light-windows-amd64.zip
asset_content_type: application/zip
- name: Upload Release Assets windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./modular-indexer-light-windows-amd64.zip
asset_name: modular-indexer-light-windows-amd64.zip
asset_content_type: application/zip

0 comments on commit 98cca12

Please sign in to comment.