Skip to content

update release action #28

update release action

update release action #28

Workflow file for this run

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/