-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further work on build server and actions workflows (#57)
* Add builder workflow * workflow dispatch * ci debug * inputs * fixed * Add register * syntax * remove ssh * run_id with template format * builder-worker working * better * can I? * nope * try new build * Add releases to builds * sudo * try without upgrade * quick edits * remove musl check * try a release * try and fix a release * explicit * add linux headers generic * upgrade * upgrade for real * try docker * relative to build dir * fine * missing file * no tty * prepare for merge * upload * more logs * add install to separate section * does this build everything? * naming * specific builder * tmate * is it explicit? * ah * intentional error * register earlier * intentional error * intentional error * publish complete
- Loading branch information
Showing
29 changed files
with
531 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
JobID: | ||
description: "ID of the job" | ||
required: true | ||
Package: | ||
description: "Package location" | ||
required: true | ||
Reference: | ||
description: Version control reference, if any | ||
required: false | ||
name: Building Package | ||
jobs: | ||
build: | ||
environment: builder | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Register | ||
run: | | ||
curl -X POST https://store.bramble.run/job/${{ github.event.inputs.JobID }}/register \ | ||
-H 'Content-Type: application/json' \ | ||
-d '{"RunID": ${{ github.run_id }}}' | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install | ||
run: | | ||
go install | ||
- name: Build ${{ github.event.inputs.Package }} ${{ github.event.inputs.Reference }} | ||
env: | ||
DIGITALOCEAN_SPACES_ACCESS_ID: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_ID }} | ||
DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }} | ||
run: | | ||
bramble publish --upload --local ${{ github.event.inputs.Package }} ${{ github.event.inputs.Reference }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM goreleaser/goreleaser | ||
|
||
RUN apk add gcc | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publishing Release | ||
on: | ||
create: | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # required for goreleaser | ||
- name: Publish release | ||
run: | | ||
docker build -t goreleaser -f .github/workflows/goreleaser.Dockerfile .github/workflows/ | ||
docker run \ | ||
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | ||
-v $(pwd):/opt \ | ||
--workdir=/opt \ | ||
goreleaser/goreleaser release --rm-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
!.vscode/settings.json | ||
.idea | ||
*.prof | ||
dist | ||
bramble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- ldflags: | ||
- -s -linkmode external -extldflags "-static" | ||
env: | ||
- CGO_ENABLED=1 | ||
- CC=musl-gcc | ||
goarch: | ||
- amd64 | ||
goos: | ||
- linux | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
amd64: x86_64 | ||
checksum: | ||
name_template: "checksums.txt" | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { terser } from 'rollup-plugin-terser' | ||
// plugin-node-resolve and plugin-commonjs are required for a rollup bundled project | ||
// to resolve dependencies from node_modules. See the documentation for these plugins | ||
// for more details. | ||
import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import typescript from '@rollup/plugin-typescript' | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: { | ||
exports: 'named', | ||
format: 'es', | ||
file: 'dist/index.mjs', | ||
sourcemap: true, | ||
}, | ||
plugins: [typescript(), commonjs(), nodeResolve({ browser: true }), terser()], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Octokit } from "octokit"; | ||
|
||
const octokit = new Octokit({ auth: "" }); | ||
|
||
(async function() { | ||
let resp = await octokit.request("GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs", { | ||
owner: "maxmcd", | ||
repo: "bramble", | ||
job_id: 4452262973, | ||
}); | ||
console.log(resp); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export {}; | ||
declare global { | ||
const GITHUB_TOKEN: string; | ||
const BRAMBLE: KVNamespace; | ||
} |
Oops, something went wrong.