-
Notifications
You must be signed in to change notification settings - Fork 22
61 lines (58 loc) · 3.39 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: goreleaser
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: latest
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-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/checksums.txt
dist/linux-arm-7-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm64-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-amd64-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-app-management-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm-7-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm-7-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-arm64-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-arm64-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz
dist/linux-amd64-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-AppManagement/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-amd64-casaos-app-management-migration-tool-${{ steps.get_version.outputs.VERSION }}.tar.gz