Skip to content

Commit

Permalink
update releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Nov 20, 2023
1 parent 889774a commit ed54412
Showing 1 changed file with 8 additions and 51 deletions.
59 changes: 8 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,12 @@ on:

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: latest
args: release --clean
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-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/checksums.txt
dist/linux-arm-7-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm64-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-amd64-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-gateway-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm-7-casaos-gateway-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-gateway-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm64-casaos-gateway-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-gateway-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-amd64-casaos-gateway-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-Gateway/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-gateway-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-Gateway
file-name: casaos
secrets:
OSS_KEY_ID: ${{ secrets.OSS_KEY_ID }}
OSS_KEY_SECRET: ${{ secrets.OSS_KEY_SECRET }}

0 comments on commit ed54412

Please sign in to comment.