Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 42 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ on:
push:
tags:
- 'v*' # Push events to matching v*, for example v1.0, v10.15.10

workflow_dispatch:
inputs:
publishRelease:
description: 'Create a new release with the artifacts'
required: false
default: 'false'
homebrew:
description: 'Make a PR for https://github.com/section/homebrew-brews'
required: false
default: 'false'
jobs:
release:
name: 🎬 Create the release
Expand All @@ -14,8 +23,11 @@ jobs:
steps:
- name: Download artifacts
uses: actions/download-artifact@v2

- name: Override github ref
if: github.event.inputs.publishRelease == "true"
run: ${{ github.ref = "v0.0.0-test" }}
- name: Create Release
if: github.event_name == "push" || github.event.inputs.publishRelease == "true"
id: create_release
uses: actions/create-release@v1
env:
Expand Down Expand Up @@ -46,7 +58,11 @@ jobs:
with:
go-version: ^1.16
id: go

- name: Override github ref
if: github.event.inputs.publishRelease == "true"
run: |
${{ github.ref = "v0.0.0-test" }}
echo "VERSION=v0.0.0-test" >> $GITHUB_ENV
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get Version
Expand All @@ -70,6 +86,7 @@ jobs:
name: sectionctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}.tar.gz
path: dist/sectionctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}
- name: Upload Release Asset
if: github.event_name == "push" || github.event.inputs.publishRelease == "true"
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -95,6 +112,11 @@ jobs:
APP_NAME: 'sectionctl'
MAINTAINER: '[email protected]'
steps:
- name: Override github ref
if: github.event.inputs.publishRelease == "true"
run: |
${{ github.ref = "v0.0.0-test" }}
echo "VERSION=v0.0.0-test" >> $GITHUB_ENV
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download dist folder
Expand Down Expand Up @@ -143,6 +165,7 @@ jobs:
name: sectionctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}.rpm
path: sectionctl-${{env.MAJORVERSION}}.${{env.MINORVERSION}}.${{env.PATCHVERSION}}-1.${{ env.ARCHSTRING }}.rpm
- name: Add RPM to Release
if: github.event_name == "push" || github.event.inputs.publishRelease == "true"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -152,6 +175,7 @@ jobs:
asset_path: sectionctl-${{env.MAJORVERSION}}.${{env.MINORVERSION}}.${{env.PATCHVERSION}}-1.${{ env.ARCHSTRING }}.rpm
asset_content_type: application/octet-stream
- name: Add Deb to Release
if: github.event_name == "push" || github.event.inputs.publishRelease == "true"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -176,6 +200,11 @@ jobs:
APP_NAME: 'sectionctl'
MAINTAINER: '[email protected]'
steps:
- name: Override github ref
if: github.event.inputs.publishRelease == "true"
run: |
${{ github.ref = "v0.0.0-test" }}
echo "VERSION=v0.0.0-test" >> $GITHUB_ENV
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Download dist folder
Expand Down Expand Up @@ -217,6 +246,7 @@ jobs:
name: sectionctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}-installer.exe
path: packaging/windows/sectionctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}-installer.exe
- name: Upload Installer Asset
if: github.event_name == "push" || github.event.inputs.publishRelease == "true"
id: upload-installer-asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -229,15 +259,21 @@ jobs:
delete_excess_artifacts:
runs-on: 'ubuntu-latest'
needs: [build, create_installer, build_linux_packages]
name: Delete unnecessary 100mb dist artifact
name: 🗑️ Delete unnecessary 100mb dist artifact
steps:
- uses: geekyeggo/delete-artifact@v1
with:
name: dist
homebrew:
name: 🍎 Bump Homebrew formula
if: github.event_name == "push" || github.event.inputs.homebrew == "true"
runs-on: ubuntu-latest
steps:
- name: Override github ref
if: github.event.inputs.publishRelease == "true"
run: |
${{ github.ref = "v0.0.0-test" }}
echo "VERSION=v0.0.0-test" >> $GITHUB_ENV
- name: Get Version
id: get_version
uses: battila7/get-version-action@v2
Expand All @@ -260,7 +296,7 @@ jobs:
commit-message: |
{{formulaName}} ${{env.VERSION}}

Created by https://github.com/mislav/bump-homebrew-formula-action
Automatically pushed from a release at https://github.com/section/sectionctl
${{ steps.extract-version.outputs.tag-name }}
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ bin/
build/
dist/
sectionctl
.vscode/
__debug_bin
# Debug outputs
sectionctl-debug-*.log
19 changes: 14 additions & 5 deletions .vscode.example/launch.json → .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "version",
"type": "go",
"request": "launch",
"mode": "debug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["version"]
},
{
"name": "deploy",
"type": "go",
"request": "launch",
"mode": "debug",
"cwd": "${workspaceFolder}/commands/testdata/deploy/api-routes-app",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["deploy", "-a", "replaceMeWithYourAccountID", "-i", "replaceMeWithYourApplicationID"]
"args": ["deploy"]
},
{
"name": "accounts/list",
Expand All @@ -26,7 +35,7 @@
"mode": "debug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["apps", "list", "-a", "replaceMeWithYourAccountID"]
"args": ["apps", "list", "-a", "1887"]
},
{
"name": "apps/info",
Expand All @@ -35,7 +44,7 @@
"mode": "debug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["apps", "info", "-a", "replaceMeWithYourAccountID", "-i", "replaceMeWithYourApplicationID"]
"args": ["apps", "info", "-a", "1887", "-i", "7749"]
},
{
"name": "apps/stacks",
Expand All @@ -62,7 +71,7 @@
"mode": "debug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["logs", "-a", "replaceMeWithYourAccountID", "-i", "replaceMeWithYourApplicationID"]
"args": ["logs", "-a", "1887", "-i", "7749"]
},
{
"name": "ps",
Expand All @@ -71,7 +80,7 @@
"mode": "debug",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/sectionctl.go",
"args": ["ps", "-a", "replaceMeWithYourAccountID"]
"args": ["ps", "-a", "1887"]
},
{
"name": "login",
Expand Down
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// "runOnSave.commands": [
// // {
// // "match": "section-graphql-api/.*.go",
// // "command": "../../run-docker-local.sh recompile",
// // "runningStatusMessage": "Run On Save is running!",
// // "runIn": "terminal"
// // },
// {
// "match": ".*\\.go$",
// "command": "gofmt -s -w ${file}",
// "runIn": "terminal"
// }
// ]
}
1 change: 1 addition & 0 deletions packaging/windows/nsis.install.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Section "sectionctl" SECTIONCTL_IDX

# Add instdir to PATH
EnVar::AddValue "PATH" "$INSTDIR"
AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"
SectionEnd


Expand Down