Skip to content

Commit

Permalink
SCALRCORE-21545 > Replace release with build
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Vang committed May 10, 2022
1 parent 732f692 commit 46101b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/default.yml
Expand Up @@ -84,29 +84,33 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ secrets.DEV_GCP_PROJECT_ID }}
service_account_key: ${{ secrets.DEV_GCP_SA_KEY }}
export_default_credentials: true
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create dev-tag
run: |
LAST_TAG=$(git describe --tags --abbrev=0)
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's|\(.*\)|\L\1|g;s|/|-|g')
git tag $LAST_TAG-$BRANCH
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.17"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
version: v1.8.3
args: release --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Upload provider to registry
env:
DOMAIN: registry.scalr.dev
BUCKET_NAME: gs://tf-registry-48e84b05eab87d56
DOMAIN: ${{ secrets.DEV_DOMAIN }}
BUCKET_NAME: ${{ secrets.DEV_BUCKET_NAME }}
GPG_KEY_ID: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_PUB_KEY: ${{ steps.import_gpg.outputs.pubkey }}
run: bash scripts/upload.sh
Expand Down
8 changes: 1 addition & 7 deletions scripts/upload.sh
Expand Up @@ -10,14 +10,8 @@ PROVIDER_SOURCE="scalr/scalr"
URL="https://$DOMAIN"
PROTOCOLS="[\"5.0\"]"

# If tag is not defined, use branch name as version
VERSION=$(PAGER= git tag --points-at HEAD)
if [ -z "$VERSION" ]; then
VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's|\(.*\)|\L\1|g;s|/|-|g')
else
VERSION=${VERSION:1}
fi

VERSION=${VERSION:1}
TMP_DIR=$(mktemp -d -t scalr-provider-$VERSION-XXXXXXXXXXX)
PROVIDER_BIN_PATH=$TMP_DIR/$PROVIDER_NAME/$VERSION
DOWNLOAD_DIR=$TMP_DIR/$PROVIDER_SOURCE/$VERSION/download/
Expand Down

0 comments on commit 46101b0

Please sign in to comment.