Skip to content

Commit

Permalink
Fix go releaser tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed May 30, 2023
1 parent aad21b9 commit bfd3d35
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ jobs:
- name: Build
run: |
export VERSION=`echo $GITHUB_REF | sed -e "s/refs\/heads\///g" -e "s/release\/\|main//g"`
export VERSION="$VERSION.$GITHUB_RUN_NUMBER"
export VERSION="v${VERSION}.$GITHUB_RUN_NUMBER"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "GORELEASER_CURRENT_TAG=v${VERSION}" >> $GITHUB_ENV
echo "GORELEASER_CURRENT_TAG=${VERSION}" >> $GITHUB_ENV
# sed -i "s/0.0.0/${VERSION}/g" src/version.go
make tfgen
make provider
- name: Create Github Release and Tag
if: github.repository_owner == 'Authress' && github.ref != 'refs/heads/main' && github.event_name == 'push'
run: |
git tag v${VERSION} -f
git push origin v${VERSION}
git tag ${VERSION} -f
git push origin ${VERSION}
- name: Import GPG key
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ builds:
- linux
ldflags:
# The line below MUST align with the module in current provider/go.mod
- -X github.com/authress/pulumi-authress/provider/pkg/version.Version={{.Tag }}
- -X github.com/Authress/pulumi-authress/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-authress/
changelog:
skip: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ go mod tidy
Blocked on https://github.com/pulumi/pulumi-terraform-bridge/issues/956

```sh
export VERSION=v1.1.1
export VERSION=v1.1.28
export PATH="/home/$USER/git/authress/sdk/pulumi:/home/$USER/git/authress/sdk/pulumi/bin:/home/$USER/git/authress/sdk/pulumi/provider/cmd:$PATH"
make tfgen
make provider
make build_nodejs
make install_nodejs_sdk
```

### Run an example

```sh
make install_nodejs_sdk
cd examples/typescript-example
yarn
yarn link @pulumi/authress
pulumi up
```

1. Configure any necessary environment variables for authentication, e.g `$AUTHRESS_KEY`, in your local environment.
Expand Down
5 changes: 5 additions & 0 deletions provider/cmd/pulumi-resource-authress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
package main

import (
"fmt"
"context"
_ "embed"

"github.com/Authress/pulumi-authress/provider/pkg/version"
authressPulumi "github.com/Authress/pulumi-authress/provider"
tfbridge "github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge"
)
Expand All @@ -21,5 +23,8 @@ func main() {
PackageSchema: pulumiSchema,
BridgeMetadata: bridgeMetadata,
}

fmt.Println("Authress Package Version:\t", version.Version)

tfbridge.Main(context.Background(), "authress", authressPulumi.Provider(), meta)
}
9 changes: 9 additions & 0 deletions provider/cmd/pulumi-tfgen-authress/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package main

import (
"fmt"
"github.com/Authress/pulumi-authress/provider/pkg/version"
authressPulumi "github.com/Authress/pulumi-authress/provider"
"github.com/pulumi/pulumi-terraform-bridge/pf/tfgen"

"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
)

func main() {
fmt.Println("Authress TF Generator Version:\t", version.Version)

// Validates the version is set correctly
tfbridge.GetModuleMajorVersion(version.Version)

// Modify the path to point to the new provider
tfgen.Main("authress", authressPulumi.Provider())
}

0 comments on commit bfd3d35

Please sign in to comment.