-
Notifications
You must be signed in to change notification settings - Fork 13
96 lines (84 loc) · 4.65 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# name: Release
# # Set up the trigger for the workflow
# on:
# # The workflow is triggered when a push event occurs on the repository
# push:
# # Define the job that runs as part of the workflow
# jobs:
# Submit:
# # Run the job on an Ubuntu machine
# runs-on: ubuntu-latest
# steps:
# # Check out the code from the repository
# - uses: actions/checkout@v3
# # Set up a Node.js environment, install the dependencies specified in the package.json file, and cache them for faster execution
# - uses: actions/setup-node@v3
# with:
# # Use Node.js version 16
# node-version: 16
# # Cache the npm dependencies for faster execution
# cache: npm
# # Use npm ci to install the dependencies if it is available, otherwise use npm install
# install-command: npm ci || npm install
# # Bump the patch version number in the package.json file (optional step, you may remove it if you don't want to bump the version number)
# # - name: Bump version number
# # env:
# # GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
# # GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
# # run: npm version patch -m "Bump version number to %s" --git-author="${{ secrets.GIT_USER_EMAIL }} <${{ secrets.GIT_USER_NAME }}>"
# # Load the secrets from the .env file into environment variables
# - name: Load secrets from .env file
# run: |
# const dotenv = require('dotenv');
# dotenv.config();
# # # Generate a file called release-notes.md containing the commit messages of the commits made since the last tag
# # - name: Generate release notes
# # run: |
# # git log --pretty=format:'%s' HEAD $(git describe --tags --abbrev=0) | awk '{print "- "$0}' > release-notes.md
# # Create a zip file of the entire project directory
# - name: Create zip file
# run: |
# zip -r "$PROJECT_NAME.zip" *
# # # Use the chrome-webstore-upload-cli tool to update the extension metadata
# # - name: Update extension metadata
# # run: |
# # npx chrome-webstore-upload-cli@2 update --extension-id $EXTENSION_ID --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --refresh-token $REFRESH_TOKEN --release-notes "$(cat release-notes.md)"
# # env:
# # # Use the EXTENSION_ID, CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN secrets as environment variables
# # # to authenticate with the Chrome Web Store API
# # EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
# # CLIENT_ID: ${{ secrets.CLIENT_ID }}
# # CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
# # REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
# # # Use the actions/create-release action to create a release on GitHub and attach the zip file to the release
# # - name: Create GitHub release
# # uses: actions/create-release@v1
# # # Use the GITHUB_TOKEN secret as an environment variable to authenticate with the GitHub API
# # env:
# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # with:
# # # Use the tag name v followed by the run number of the workflow
# # tag_name: v${{ github.run_number }}
# # # Use the release name "Release" followed by the run number of the workflow
# # release_name: Release ${{ github.run_number }}
# # # Use the contents of the release-notes.md file as the body of the release
# # body_path: release-notes.md
# # Use the chrome-webstore-upload-cli tool to upload the zip file to the Chrome Web Store and publish the extension
# - name: Submit extension
# run: |
# npx chrome-webstore-upload-cli@2 upload --extension-id $EXTENSION_ID --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --refresh-token $REFRESH_TOKEN --zip-file "$PROJECT_NAME.zip"
# env:
# # Use the EXTENSION_ID, CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN secrets as environment variables
# # to authenticate with the Chrome Web Store API
# # EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
# # CLIENT_ID: ${{ secrets.CLIENT_ID }}
# # CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
# # REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
# # to authenticate with the Chrome Web Store API
# EXTENSION_ID: ${process.env.EXTENSION_ID}
# CLIENT_ID: ${process.env.CLIENT_ID}
# CLIENT_SECRET: ${process.env.CLIENT_SECRET}
# REFRESH_TOKEN: ${process.env.REFRESH_TOKEN}
# # Clean up by deleting the zip file
# - name: Clean up
# run: rm "$PROJECT_NAME.zip"