Skip to content

Commit

Permalink
Deleted old repository as it was littered with old binaries
Browse files Browse the repository at this point in the history
- The changelog should suffice for missing git history up until this point
  • Loading branch information
Phillip Miller committed Oct 14, 2021
0 parents commit 46fee5e
Show file tree
Hide file tree
Showing 38 changed files with 5,205 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/configuration_repo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature", "enhancement"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix", "bug"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
}
],
"sort": "ASC",
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
"pr_template": "${{TITLE}}\n - PR: #${{NUMBER}}\n${{BODY}}\n${{MILESTONE}}",
"empty_template": "**Full Changelog** https://github.com/${{OWNER}}/${{REPO}}/compare/${{FROM_TAG}}...${{TO_TAG}}",
"label_extractor": [
{
"pattern": "(.) (.+)",
"target": "$1",
"flags": "gu"
},
{
"pattern": "\\[Issue\\]",
"on_property": "title",
"method": "match"
}
],
"duplicate_filter": {
"pattern": "\\[ABC-....\\]",
"on_property": "title",
"method": "match"
},
"transformers": [
{
"pattern": "[\\-\\*] (\\[(...|TEST|CI|SKIP)\\])( )?(.+?)\n(.+?[\\-\\*] )(.+)",
"target": "- $4\n - $6"
}
],
"max_tags_to_fetch": 500,
"max_pull_requests": 500,
"max_back_track_time_days": 365,
"tag_resolver": {
"method": "semver"
}
}
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '38 4 * * 0'

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

strategy:
fail-fast: false
matrix:
go-version: [1.17.x]
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

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
168 changes: 168 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# This is a basic workflow

name: CI

# Controls when the action will run. Triggers the workflow on push with tags
on:
push:
tags:
- '*'
pull_request:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# The "build" workflow
build:
# The type of runner that the job will run on
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Setup Go
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@preview
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
# Install all the dependencies
- name: Install dependencies
run: |
go version
go get -u golang.org/x/lint/golint
go get github.com/mattn/[email protected]
# Run build of the application
- name: Run build
run: |
go env -w GOFLAGS=-mod=mod
go mod tidy
go build -v .
# Run pimp-my-shell
- name: Run pimp-my-shell
run: |
./pimp-my-shell
cat "$HOME/.zshrc"
# Run vet & lint on the code
- name: Run vet & lint
run: |
go vet ./...
golint ./...
generate-milestone:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required due to the weg Git works, without it this action won't be able to find any or the correct tags
- name: Get Previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: v1.0.0 # Optional fallback tag to use when no tag can be found
- name: Get next minor version
id: semvers
uses: WyriHaximus/github-action-next-semvers@v1
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create new milestone
id: createmilestone
uses: WyriHaximus/github-action-create-milestone@v1
with:
title: ${{ steps.semvers.outputs.patch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ================
# RELEASE JOB
# runs after a successful build
# only runs on push "v*" tag
# ================
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1000

# Setup Go
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x

- name: Cache Go modules
uses: actions/cache@preview
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
# Install all the dependencies
- name: Install dependencies
run: |
go version
go get github.com/mattn/[email protected]
# Run build of the application
- name: Run build and MakeFile
id: binaries
run: |
go env -w GOFLAGS=-mod=mod
go mod tidy
go build -v .
make -f MakeFile all
- name: Get current tag name
run: |
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "PREVIOUS_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> $GITHUB_ENV
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: ".github/configuration_repo.json"
owner: "mr-pmillz"
repo: "pimp-my-shell"
fromTag: ${{ env.PREVIOUS_TAG }}
toTag: ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: success()
uses: softprops/action-gh-release@v1
with:
body: ${{steps.github_release.outputs.changelog}}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
files: |
bin/linux/amd64/pimp-my-shell-linux-amd64.gz
bin/linux/arm64/pimp-my-shell-linux-arm64.gz
bin/darwin/amd64/pimp-my-shell-x86_64-apple-darwin_amd64.gz
bin/darwin/arm64/pimp-my-shell-x86_64-apple-darwin_arm64.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/scheduled-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Scheduled Release

on:
schedule:
- cron: '0 0 * * 1' # Every Monday at 00:00 AM UTC on the default branch

jobs:
analyze-tags:
runs-on: ubuntu-latest
outputs:
previous-tag: ${{ steps.previoustag.outputs.tag }}
timestamp-diff: ${{ steps.diff.outputs.timestamp-diff }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
#▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼#
- name: Get previous tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1
#▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲#
- name: Get seconds from previous tag to now
id: diff
shell: bash
env:
TIMESTAMP_TAG: ${{ steps.previoustag.outputs.timestamp }}
run: |
echo "::set-output name=timestamp-diff::$(expr $(printf '%(%s)T') - $TIMESTAMP_TAG)"
schedule-release:
runs-on: ubuntu-latest
needs: analyze-tags
if: needs.analyze-tags.outputs.timestamp-diff > 604800 # 604800 equal one week.
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get next minor version
id: semvers
uses: WyriHaximus/github-action-next-semvers@v1
with:
version: ${{ needs.analyze-tags.outputs.previous-tag }}

# Now schedule the release...

# In the example below, a file is changed
# (the scheduled tag is written to an arbitrary property within a package.json file).
# The following commit would then trigger a semantic release through a following workflow
# (https://github.com/semantic-release/semantic-release)

- name: manifest Version
uses: deef0000dragon1/json-edit-action/@v1
env:
KEY: scheduleVersion
VALUE: ${{ steps.semvers.outputs.patch }}
FILE: package.json
- uses: stefanzweifel/[email protected]
with:
commit_message: 'fix(release): schedule release'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
pimp-my-shell
.DS_STORE
bin/*
Loading

0 comments on commit 46fee5e

Please sign in to comment.