-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (65 loc) · 2.39 KB
/
main.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
name: Fetch IAM Actions and update this VSCode extension.
on:
workflow_dispatch:
schedule:
- cron: "10 9 * * 5" # At 09:10 on Friday.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install Python
run: |
set -x -e
sudo apt install python3-setuptools
python3 -m pip install --upgrade pip && pip3 install -r src/requirements.txt
- name: Update the iam actions snippets
run: |
echo "Update the iam actions snippets"
python3 src/update-iam-action-snippets.py --workers 20
- name: Check for changes
id: git-check
run: |
git diff --exit-code || echo "::set-output name=changes_exist::true"
- name: Commit changes to Github
if: steps.git-check.outputs.changes_exist == 'true'
run: |
set -x -e
# Configure git
git config --global user.name 'Github Actions'
git config --global user.email '[email protected]'
# Update version
npm version minor --force --no-git-tag-version
package_version=$(cat package.json | grep 'version":' | sed 's/[",]//g' | awk '{print $2}')
# Install dependencies and prepare for publishing
npm install
npm run vscode:prepublish
# Generate changelog
gitchangelog | tee "CHANGELOG.md"
# Commit and push changes
git commit -am "build: auto-update snippets to version: $package_version"
git push
# Create and push tag
git tag $package_version
git push origin --tags
- name: Publish to Visual Studio Marketplace
if: steps.git-check.outputs.changes_exist == 'true'
uses: HaaLeo/publish-vscode-extension@v1
id: publishToVSCE
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
- name: Publish to Open VSX Registry
if: steps.git-check.outputs.changes_exist == 'true'
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ steps.publishToVSCE.outputs.vsixPath }}