Skip to content

Commit c4e82f1

Browse files
Merge pull request #1 from richardmarston/master
Implement publishing pipeline
2 parents 589b009 + f3b955b commit c4e82f1

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.github/workflows/trigger.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Trigger excel2md
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
dispatch_event:
10+
runs-on: ubuntu-latest
11+
name: Dispatch event
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Get version info
18+
id: tag
19+
run: |
20+
NEXT_VERSION=$(./get_next.sh ${{ github.repository_owner }} excel2xml-input)
21+
echo "NEXT_VERSION: ${NEXT_VERSION}"
22+
echo ::set-output name=next-release::${NEXT_VERSION}
23+
24+
- name: Create Archive
25+
id: create-archive
26+
run: |
27+
zip -r grupoetra grupoetra/*.xlsx
28+
29+
- name: Create Release
30+
id: create-release
31+
uses: actions/create-release@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ steps.tag.outputs.next-release }}
36+
release_name: ${{ steps.tag.outputs.next-release }}
37+
draft: false
38+
prerelease: false
39+
40+
- name: Upload Release Asset
41+
id: upload-release-asset
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ steps.create-release.outputs.upload_url }}
47+
asset_path: ./grupoetra.zip
48+
asset_name: grupoetra.zip
49+
asset_content_type: application/zip
50+
51+
- uses: juztcode/repo-ditpatch-action@v1
52+
with:
53+
event-type: release_event
54+
token: ${{ secrets.REPO_TRIGGER_KEY }}
55+
repository: "${{ github.repository_owner }}/excel2xml"
56+
client-payload: '{"tag": "${{ steps.tag.outputs.next-release }}" }'

get_next.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
owner_url=$1
2+
repo_name=$2
3+
latest_url=$(wget https://github.com/${owner_url}/${repo_name}/releases/latest --max-redirect=0 2>&1 | grep Location)
4+
prefix="Location: https://github.com/${owner_url}/${repo_name}/releases/tag/"
5+
suffix=" [following]"
6+
tail=${latest_url#"$prefix"}
7+
release_version=${tail%"$suffix"}
8+
major=`echo $release_version | cut -d. -f1`
9+
minor=`echo $release_version | cut -d. -f2`
10+
revision=`echo $release_version | cut -d. -f3`
11+
revision=`expr $revision + 1`
12+
echo ${major}.${minor}.${revision}
-5.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)