-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (71 loc) · 2.99 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
on:
push:
branches:
- main
- surface
name: Release Box
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Main Repo
uses: actions/checkout@v3
with:
ref: main
- name: Get Env
run: |
echo "REPO_NAME=${{ github.repository }}" >> $GITHUB_ENV
echo "REPO_BASENAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: New tag
id: new-tag
run: |
LATEST_RELEASE_INFO=$(curl -s https://api.github.com/repos/${{ env.REPO_NAME }}/releases/latest)
NEW_VERSION_LINK=$(echo "$LATEST_RELEASE_INFO" | grep "browser_download_url.*${{ env.REPO_BASENAME }}*" | cut -d: -f2,3 | tr -d \")
NEW_VERSION=$( echo "${NEW_VERSION_LINK}" | cut -d/ -f9)
NEW_VERSION_NO_EXT=$( echo ${NEW_VERSION} | cut -d. -f1)
NEW_VERSION_NAME=$(echo "$LATEST_RELEASE_INFO" | grep "name.*${{ env.REPO_BASENAME }}*" | cut -d: -f2,3 | tr -d \" | head -n 1 | tr -d \,)
GET_TAG=$(echo "$NEW_VERSION_NAME" | cut -d " " -f3)
TAG_1=$(echo "$GET_TAG" | cut -d. -f1)
TAG_2=$(echo "$GET_TAG" | cut -d. -f2)
TAG_3=$(echo "$GET_TAG" | cut -d. -f3)
NEW_TAG=$(echo "$(( $TAG_3 + 1 ))")
TAG="${TAG_1}.${TAG_2}.${NEW_TAG}"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.new-tag.outputs.tag }}
name: ${{ env.REPO_BASENAME }} ${{ steps.new-tag.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
commit: "main"
prerelease: false
draft: false
- name: Tar gz Main
run: |
tar -czvf InterAACtionBox-main.tar.gz ./ISOScripts/ ./Libs/ ./Ressources/ ./Scripts/ ./slides/
- name: Upload Main to Release
id: upload-main-assets
uses: csexton/release-asset-action@v2
with:
release-url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
files: |
InterAACtionBox-main.tar.gz
install.sh
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Surface Repo
uses: actions/checkout@v3
with:
ref: surface
- name: Tar gz Surface
run: |
tar -czvf InterAACtionBox-surface.tar.gz ./ISOScripts/ ./Libs/ ./Ressources/ ./Scripts/ ./slides/
- name: Upload Surface to Release
id: upload-surface-assets
uses: csexton/release-asset-action@v2
with:
release-url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`.
files: |
InterAACtionBox-surface.tar.gz
install_surface.sh
github-token: ${{ secrets.GITHUB_TOKEN }}