on: push: # Sequence of patterns matched against refs/tags tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 name: Create Release And Upload assets jobs: create-release: runs-on: ubuntu-latest steps: - name: Install cross-compilers run: sudo apt-get update && sudo apt-get -y install gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi gcc-powerpc64le-linux-gnu gcc-s390x-linux-gnu - name: Checkout code uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18.14' - name: Build Web run: | cd frontend && npm install && npm run build:dev env: NODE_OPTIONS: --max-old-space-size=8192 - name: Setup Go uses: actions/setup-go@v4 with: go-version: '1.20.x' - name: Build Release uses: goreleaser/goreleaser-action@v4 with: args: release --skip-publish --clean - name: Upload Assets uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: draft: true files: | dist/*.tar.gz dist/checksums.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup OSSUTIL uses: yizhoumo/setup-ossutil@v1 with: endpoint: ${{ secrets.OSS_ENDPOINT }} access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }} access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} ossutil-version: '1.7.14' - name: Upload Assets to OSS run: ossutil cp -r dist/ oss://resource-fit2cloud-com/1panel/package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --only-current-dir