Skip to content

Commit

Permalink
feat: new build pipeline
Browse files Browse the repository at this point in the history
* chore: build workflow

* chore: remove release-please

* feat: new build pipeline
  • Loading branch information
domenicsim1 authored Jul 7, 2022
1 parent f2c5082 commit 4788381
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 2 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build

on:
push:
schedule:
# Daily 5am australian/brisbane time (7pm UTC)
- cron: "0 19 * * *"
release:
types: [created]
env:
OCTOPUS_CLI_SERVER: ${{ secrets.OCTOPUS_URL }}
OCTOPUS_CLI_API_KEY: ${{ secrets.INTEGRATIONS_API_KEY }}

jobs:
build:
name: Build code
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.build.outputs.package_version }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
- name: Build
id: build
run: |
npm ci
export VERSION=$(jq '.version' package.json | sed 's/"//g')
npm run pack
echo "::set-output name=package_version::$VERSION"
- uses: actions/upload-artifact@v3
with:
name: vscode-octopusdeploy-${{ steps.build.outputs.package_version }}.vsix
path: vscode-octopusdeploy-${{ steps.build.outputs.package_version }}.vsix
package:
name: Package and Push artifacts to Octopus
needs: [build]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: vscode-octopusdeploy-${{ needs.build.outputs.package_version }}.vsix
path: vscode-octopusdeploy-${{ needs.build.outputs.package_version }}.vsix
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
cache: "npm"
- name: Create Package
id: create-packages
run: |
tar -czf vscode-octopusdeploy.${{ needs.build.outputs.package_version }}.tar.gz vscode-octopusdeploy-${{ needs.build.outputs.package_version }}.vsix
- name: Install Octopus CLI 🐙
uses: OctopusDeploy/install-octopus-cli-action@v1
with:
version: "*"
- name: Push Package 🐙
uses: OctopusDeploy/push-package-action@v1
with:
space: "Integrations"
packages: |
vscode-octopusdeploy.${{ needs.build.outputs.package_version }}.tar.gz
- name: Push build information to Octopus Deploy 🐙
if: ${{ github.event_name == 'release' }}
uses: OctopusDeploy/push-build-information-action@v1
with:
package: |
'vscode-octopusdeploy.${{ needs.build.outputs.package_version }}.tar.gz'
version: '${{ needs.build.outputs.package_version }}'
- name: Create a release in Octopus Deploy 🐙
uses: OctopusDeploy/create-release-action@v1.1.1
with:
space: "Integrations"
project: "Visual Studio Code Plugin"
package_version: ${{ needs.build.outputs.package_version }}
channel: ${{ 'Public' }}
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '18 1 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
3 changes: 2 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: release-please-action
token: ${{ secrets.INTEGRATIONS_FNM_BOT_TOKEN }}
package-name: vscode-octopusdeploy
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "0.0.17",
"publisher": "OctopusDeploy",
"engines": {
"vscode": "^1.61.0"
"vscode": "^1.64.0"
},
"bugs": {
"url": "https://github.com/OctopusDeploy/vscode-octopusdeploy/issues",
Expand Down Expand Up @@ -130,6 +130,7 @@
"scripts": {
"chrome": "npm run compile && vscode-test-web --browserType=chromium --extensionDevelopmentPath=.",
"compile": "webpack",
"pack": "vsce package",
"deploy": "vsce publish",
"lint": "eslint src --ext ts",
"package": "webpack --mode production --devtool hidden-source-map",
Expand Down

0 comments on commit 4788381

Please sign in to comment.