Skip to content

Commit

Permalink
commenting out uneeded code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-courtney-pieces committed May 22, 2024
1 parent 19f997c commit 902b679
Showing 1 changed file with 102 additions and 102 deletions.
204 changes: 102 additions & 102 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,105 +77,105 @@ jobs:
run: ls -la

### Pushing the built packages to GCP and GitHub
push-build:
runs-on: ubuntu-latest
needs:
- not_now
steps:

### Pulling down the previously built plugins
- uses: actions/download-artifact@v3
with:
name: output

### Pulling down the staging version number to pass to gcp and GitHub releases
- uses: actions/download-artifact@v3
with:
name: staging_version
if: inputs.deploy == false

### What is in here??
- name: List
run: ls -la

### Authenticating with gcloud
- name: Authenticate with Google cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.credentials_json }}
project_id: ${{ inputs.project_id }}
create_credentials_file: true

### Setting up gcloud cli
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

### Verifying that we are good to go with gcloud
- name: 'Use gcloud CLI'
run: 'gcloud info'

### Getting either the git tag or branch name to be set in the json
- name: Get the version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT

### Installing some machine deps
- name: Install Dependencies
run: sudo apt-get install jq -y

### This big, long if statement handles pushing the builds to the correct location, as well as setting the proper
### build info for the json files read by the server
- name: Upload Artifacts
run: |
GITHUB_RUN_NUMBER+="gha"
if [[ ${{ steps.get_version.outputs.VERSION }} =~ [0-9]+.[0-9]+.[0-9]+ ]]; then
echo "Git Tag Versioning"
export CHANNEL=production
export VERSION=${{ steps.get_version.outputs.VERSION }}
export BUCKET=app-releases-production
export production_json="$(curl https://storage.googleapis.com/app-releases-production/plugin_sublime/production/latest.json -H "Accept: application/json")"
export reversed_production_json=$(echo $production_json | jq 'reverse')
export updated_production_json=$(echo $reversed_production_json | jq --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '.[length] |= . + {channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}')
echo $updated_production_json | jq 'reverse' > latest.json
jq -n --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '{channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}' > latest-single.json
else
echo "Staging Versioning"
export CHANNEL=staging
export VERSION=$(echo "$(set -- ./*.txt; echo "$1")" | xargs head -n 1)
export BUCKET=app-releases-staging
export staging_json="$(curl https://storage.googleapis.com/app-releases-staging/plugin_sublime/staging/latest.json -H "Accept: application/json")"
export reversed_staging_json=$(echo $staging_json | jq 'reverse')
export updated_staging_json=$(echo $reversed_staging_json | jq --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '.[length] |= . + {channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}')
echo $updated_staging_json | jq 'reverse' > latest.json
jq -n --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '{channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}' > latest-single.json
fi
gsutil -h "Cache-Control: max-age=0" cp **.tar.gz gs://$BUCKET/plugin_sublime/$GITHUB_RUN_NUMBER/Pieces.sublime-package
gsutil -h "Cache-Control: max-age=0" cp latest-single.json gs://$BUCKET/plugin_sublime/$CHANNEL/latest-single.json
gsutil -h "Cache-Control: max-age=0" cp latest.json gs://$BUCKET/plugin_sublime/$CHANNEL/latest.json
gsutil cp -r **.tar.gz gs://$BUCKET/plugin_sublime/release/
gsutil cp -r **.whl gs://$BUCKET/plugin_sublime/release/
echo "releasetag=$VERSION" >> $GITHUB_ENV
### Upload to GitHub releases pre-release
- name: Release to GitHub Releases
uses: softprops/action-gh-release@v1
if: inputs.deploy == false
with:
files: Pieces.sublime-package
fail_on_unmatched_files: true
name: ${{ env.releasetag }}
tag_name: ${{ env.releasetag }}
generate_release_notes: true
prerelease: true

### Upload to GitHub releases
- name: Release to GitHub Releases
uses: softprops/action-gh-release@v1
if: inputs.deploy == true
with:
files: Pieces.sublime-package
fail_on_unmatched_files: true
name: ${{ env.releasetag }}
tag_name: ${{ env.releasetag }}
generate_release_notes: true
prerelease: false
# push-build:
# runs-on: ubuntu-latest
# needs:
# - not_now
# steps:
#
# ### Pulling down the previously built plugins
# - uses: actions/download-artifact@v3
# with:
# name: output
#
# ### Pulling down the staging version number to pass to gcp and GitHub releases
# - uses: actions/download-artifact@v3
# with:
# name: staging_version
# if: inputs.deploy == false
#
# ### What is in here??
# - name: List
# run: ls -la
#
# ### Authenticating with gcloud
# - name: Authenticate with Google cloud
# uses: google-github-actions/auth@v2
# with:
# credentials_json: ${{ secrets.credentials_json }}
# project_id: ${{ inputs.project_id }}
# create_credentials_file: true
#
# ### Setting up gcloud cli
# - name: 'Set up Cloud SDK'
# uses: 'google-github-actions/setup-gcloud@v2'
#
# ### Verifying that we are good to go with gcloud
# - name: 'Use gcloud CLI'
# run: 'gcloud info'
#
# ### Getting either the git tag or branch name to be set in the json
# - name: Get the version
# id: get_version
# run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
#
# ### Installing some machine deps
# - name: Install Dependencies
# run: sudo apt-get install jq -y
#
# ### This big, long if statement handles pushing the builds to the correct location, as well as setting the proper
# ### build info for the json files read by the server
# - name: Upload Artifacts
# run: |
# GITHUB_RUN_NUMBER+="gha"
# if [[ ${{ steps.get_version.outputs.VERSION }} =~ [0-9]+.[0-9]+.[0-9]+ ]]; then
# echo "Git Tag Versioning"
# export CHANNEL=production
# export VERSION=${{ steps.get_version.outputs.VERSION }}
# export BUCKET=app-releases-production
# export production_json="$(curl https://storage.googleapis.com/app-releases-production/plugin_sublime/production/latest.json -H "Accept: application/json")"
# export reversed_production_json=$(echo $production_json | jq 'reverse')
# export updated_production_json=$(echo $reversed_production_json | jq --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '.[length] |= . + {channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}')
# echo $updated_production_json | jq 'reverse' > latest.json
# jq -n --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '{channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}' > latest-single.json
# else
# echo "Staging Versioning"
# export CHANNEL=staging
# export VERSION=$(echo "$(set -- ./*.txt; echo "$1")" | xargs head -n 1)
# export BUCKET=app-releases-staging
# export staging_json="$(curl https://storage.googleapis.com/app-releases-staging/plugin_sublime/staging/latest.json -H "Accept: application/json")"
# export reversed_staging_json=$(echo $staging_json | jq 'reverse')
# export updated_staging_json=$(echo $reversed_staging_json | jq --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '.[length] |= . + {channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}')
# echo $updated_staging_json | jq 'reverse' > latest.json
# jq -n --arg number "$GITHUB_RUN_NUMBER" --arg channel "$CHANNEL" --arg branch "${{ steps.get_version.outputs.VERSION }}" --arg tag "$VERSION" --arg sha1 "${{ github.sha }}" '{channel: $channel, number: $number, branch: $branch, tag: $tag, sha1: $sha1}' > latest-single.json
# fi
# gsutil -h "Cache-Control: max-age=0" cp **.tar.gz gs://$BUCKET/plugin_sublime/$GITHUB_RUN_NUMBER/Pieces.sublime-package
# gsutil -h "Cache-Control: max-age=0" cp latest-single.json gs://$BUCKET/plugin_sublime/$CHANNEL/latest-single.json
# gsutil -h "Cache-Control: max-age=0" cp latest.json gs://$BUCKET/plugin_sublime/$CHANNEL/latest.json
# gsutil cp -r **.tar.gz gs://$BUCKET/plugin_sublime/release/
# gsutil cp -r **.whl gs://$BUCKET/plugin_sublime/release/
# echo "releasetag=$VERSION" >> $GITHUB_ENV
#
# ### Upload to GitHub releases pre-release
# - name: Release to GitHub Releases
# uses: softprops/action-gh-release@v1
# if: inputs.deploy == false
# with:
# files: Pieces.sublime-package
# fail_on_unmatched_files: true
# name: ${{ env.releasetag }}
# tag_name: ${{ env.releasetag }}
# generate_release_notes: true
# prerelease: true
#
# ### Upload to GitHub releases
# - name: Release to GitHub Releases
# uses: softprops/action-gh-release@v1
# if: inputs.deploy == true
# with:
# files: Pieces.sublime-package
# fail_on_unmatched_files: true
# name: ${{ env.releasetag }}
# tag_name: ${{ env.releasetag }}
# generate_release_notes: true
# prerelease: false

0 comments on commit 902b679

Please sign in to comment.