-
Notifications
You must be signed in to change notification settings - Fork 26
54 lines (44 loc) · 1.68 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
name: Release
on:
push:
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
CMD_VERSION: ${{ github.ref }}
steps:
- name: Adjust CMD_VERSION
run: echo "CMD_VERSION=${CMD_VERSION:1}" >> $GITHUB_ENV
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Java and Maven
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
- name: Publish package
run: mvn -B package -DskipTests=true -Dgpg.skip=true -Djavadoc.skip=true
- name: Upload Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitName: true
artifacts: 'odps-console-dist-public/target/odpscmd_public.zip'
token: ${{ secrets.RELEASE_TOKEN }}
- run: |
sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash
cat $CMD_VERSION > version
to_oss() {
ossutil64 -e ${{secrets.OSS_ENDPOINT}} -i ${{secrets.OSS_KEY_ID}} -k ${{secrets.OSS_KEY_SECRET}} cp $1 $2 -f
ossutil64 -e ${{secrets.OSS_ENDPOINT}} -i ${{secrets.OSS_KEY_ID}} -k ${{secrets.OSS_KEY_SECRET}} set-acl $1 public-read
}
to_oss odps-console-dist-public/target/odpscmd_public.zip oss://maxcompute-repo/odpscmd/latest/
to_oss version oss://maxcompute-repo/odpscmd/latest/version
to_oss odps-console-dist-public/target/odpscmd_public.zip oss://maxcompute-repo/odpscmd/$CMD_VERSION/