From 9c9a30c028ce45274d2be02e62a969e3caec10b4 Mon Sep 17 00:00:00 2001 From: Link Date: Mon, 20 Nov 2023 10:00:15 +0000 Subject: [PATCH] uodate releaser --- .github/workflows/release.yml | 60 +++++------------------------------ .goreleaser.yaml | 12 +++---- 2 files changed, 14 insertions(+), 58 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50f2273..a1829c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,58 +4,14 @@ on: push: tags: - v*.*.* - permissions: contents: write - jobs: - goreleaser: - runs-on: ubuntu-22.04 - steps: - - name: Install dependencies for cross-compiling - run: | - sudo apt update - sudo apt-get --no-install-recommends --yes install \ - upx libc6-dev-amd64-cross \ - gcc-aarch64-linux-gnu libc6-dev-arm64-cross \ - gcc-arm-linux-gnueabihf libc6-dev-armhf-cross - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Fetch all tags - run: git fetch --force --tags - - name: Get version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: "1.20" - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - with: - # either 'goreleaser' (default) or 'goreleaser-pro' - distribution: goreleaser - version: 1.14.1 - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution - # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - - name: Upload to oss - id: upload_to_oss - uses: tvrcgo/upload-to-oss@master - with: - key-id: ${{ secrets.OSS_KEY_ID }} - key-secret: ${{ secrets.OSS_KEY_SECRET }} - region: oss-cn-shanghai - bucket: casaos - assets: | - dist/checksums.txt:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/checksums.txt - dist/linux-arm-7--casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz - dist/linux-arm64-casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz - dist/linux-amd64-casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-user-service-${{ steps.get_version.outputs.VERSION }}.tar.gz - dist/linux-arm-7--casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz - dist/linux-arm64-casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz - dist/linux-amd64-casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UserService/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-user-service-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz + call-workflow-passing-data: + uses: IceWhaleTech/github/.github/workflows/go_release.yml@main + with: + project-name: CasaOS-UserService + file-name: casaos-user-service + secrets: + OSS_KEY_ID: ${{ secrets.OSS_KEY_ID }} + OSS_KEY_SECRET: ${{ secrets.OSS_KEY_SECRET }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index dba7a6a..a7aaad5 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -31,9 +31,9 @@ builds: - amd64 - id: casaos-user-service-arm64 binary: build/sysroot/usr/bin/casaos-user-service - hooks: - post: - - upx --best --lzma -v --no-progress "{{ .Path }}" + # hooks: + # post: + # - upx --best --lzma -v --no-progress "{{ .Path }}" env: - CC=aarch64-linux-gnu-gcc ldflags: @@ -97,9 +97,9 @@ builds: - amd64 - id: casaos-user-service-migration-tool-arm64 binary: build/sysroot/usr/bin/casaos-user-service-migration-tool - hooks: - post: - - upx --best --lzma -v --no-progress "{{ .Path }}" + # hooks: + # post: + # - upx --best --lzma -v --no-progress "{{ .Path }}" main: ./cmd/migration-tool env: - CC=aarch64-linux-gnu-gcc