Owr actions update (#19)
* Go for Broke * Let it fire * Add PipLine * Create the dir if it doesn't exist * Install Setuptools * Track Test Action's files * Fix Calling Job * Track Build Action files * Install Distutils, rename filenames * Fix Fail conditions * Make Build scripts smarter * Add file * Concat DLLs lists * Try to fail if Error DLLs * Try to make the fail smarter * Moar verbosity * Print the stuff first * Print outputs objects * See if this skips failure * Use py instead * Print error list * Don't ValueError * Try checking a different way * Try something else * Bleh, spell filename correctly * Update excluded_dlls.json * Ugh, gotta compare old to new somehow * Compare to old list * Condense build script * Moar verbosity * Update the global version * Update Excluded DLLs list * Actually use the bad DLLs list * Make a version number * Fix version number building * Fix version number building again * Fix Diagnostics * Try REST API stuff * Try REST API again * Moar REST * await * Get SHA * Try it all together * Del test workflow * Add Perms * Use a Token * Try this Token * Try different Token * Try different Token * Create App Version earlier * See this error again * Don't fail if App Version not made yet * Use New Secret * Print whole response * Documentation for Tagger * Update CI Instructions * Update CI * List References * Find latest tag Fix App Version getter * Fix commas * Check returned data * Update Build Script * Fix substring * Fix Git tag * Fix tag again * Visual indicators * Use encoding * Remove an indicator * Update CI * Update Project Name * PyInstaller Spec Template file * Update Build Script * Fix Tagger * Update CI * Download AppVersion during build * Test job can fail * Upload Logs instead of printing them * Change from Reusable Workflow to Action * Change ref to token * Compare to string * Use PAT * Use String literal * Remove Reusable Workflow * Update CI Scripts * Go for Broke * Let it fire * Add PipLine * Create the dir if it doesn't exist * Install Setuptools * Track Test Action's files * Fix Calling Job * Track Build Action files * Install Distutils, rename filenames * Fix Fail conditions * Make Build scripts smarter * Add file * Concat DLLs lists * Try to fail if Error DLLs * Try to make the fail smarter * Moar verbosity * Print the stuff first * Print outputs objects * See if this skips failure * Use py instead * Print error list * Don't ValueError * Try checking a different way * Try something else * Bleh, spell filename correctly * Update excluded_dlls.json * Ugh, gotta compare old to new somehow * Compare to old list * Condense build script * Moar verbosity * Update the global version * Update Excluded DLLs list * Actually use the bad DLLs list * Make a version number * Fix version number building * Fix version number building again * Fix Diagnostics * Try REST API stuff * Try REST API again * Moar REST * await * Get SHA * Try it all together * Del test workflow * Add Perms * Use a Token * Try this Token * Try different Token * Try different Token * Create App Version earlier * See this error again * Don't fail if App Version not made yet * Use New Secret * Print whole response * Documentation for Tagger * Update CI Instructions * Update CI * List References * Find latest tag Fix App Version getter * Fix commas * Check returned data * Update Build Script * Fix substring * Fix Git tag * Fix tag again * Visual indicators * Use encoding * Remove an indicator * Update CI * Update Project Name * PyInstaller Spec Template file * Update Build Script * Fix Tagger * Update CI * Download AppVersion during build * Test job can fail * Upload Logs instead of printing them * Change from Reusable Workflow to Action * Change ref to token * Compare to string * Use PAT * Use String literal * Remove Reusable Workflow * Update CI Scripts --------- Co-authored-by: Minnie A. Trethewey (Mike) <minnietrethewey@gmail.com>
This commit is contained in:
76
.github/actions/tag-repo/action.yml
vendored
Normal file
76
.github/actions/tag-repo/action.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
name: 🏷️Tag Repository
|
||||
description: Tag a repository
|
||||
|
||||
inputs:
|
||||
repository:
|
||||
description: "Repository Owner/Name; octocat/Hello-World"
|
||||
required: true
|
||||
ref-name:
|
||||
description: "Reference name; branch, tag, etc"
|
||||
required: true
|
||||
github-tag:
|
||||
description: "Reference to tag with"
|
||||
required: true
|
||||
debug:
|
||||
description: "Debug Mode, won't set tag"
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: 🏷️Tag Repository
|
||||
uses: actions/github-script@v7.0.1
|
||||
with:
|
||||
github-token: ${{ env.FINE_PAT }}
|
||||
script: |
|
||||
const debug = ${{ inputs.debug }} == "true" || ${{ inputs.debug }} == true;
|
||||
const repository = '${{ inputs.repository }}';
|
||||
const owner = repository.substring(0,repository.indexOf('/'));
|
||||
const repo = repository.substring(repository.indexOf('/')+1);
|
||||
const ref = '${{ inputs.ref-name }}';
|
||||
// get git tag
|
||||
const gitTag = '${{ inputs.github-tag }}';
|
||||
console.log('Repo Data: ', `${owner}/${repo}@${ref}`)
|
||||
console.log('Git tag: ', gitTag)
|
||||
if(gitTag == '') {
|
||||
let msg = 'Result: 🔴No Git Tag sent, aborting!';
|
||||
console.log(msg)
|
||||
core.setFailed(msg)
|
||||
return
|
||||
}
|
||||
// get latest commit
|
||||
const latestCommit = await github.rest.git.getRef({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
ref: ref
|
||||
})
|
||||
// get latest refs
|
||||
const latestRefs = await github.rest.git.listMatchingRefs({
|
||||
owner: owner,
|
||||
repo: repo
|
||||
})
|
||||
let latestTag = ''; // bucket for latest tag
|
||||
// get last tag in data
|
||||
for(let thisRef of latestRefs.data) {
|
||||
if(thisRef['ref'].indexOf('tags') > -1) {
|
||||
let refParts = thisRef['ref'].split('/');
|
||||
latestTag = refParts[-1];
|
||||
}
|
||||
}
|
||||
console.log('Latest tag:', latestTag)
|
||||
if(latestTag != gitTag) {
|
||||
if(debug) {
|
||||
console.log(`DEBUG: 🔵Creating '${gitTag}' tag`)
|
||||
} else {
|
||||
console.log(`Result: 🟢Creating '${gitTag}' tag`)
|
||||
github.rest.git.createRef({
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
ref: `refs/tags/${gitTag}`,
|
||||
sha: latestCommit.data.object.sha
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('Result: 🟡Not creating release tag')
|
||||
}
|
||||
Reference in New Issue
Block a user