forked from hashicorp/terraform-ls
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update version and add go releaser
- Loading branch information
Showing
6 changed files
with
67 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,36 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version' | ||
required: true | ||
type: string | ||
sha: | ||
description: 'SHA' | ||
required: true | ||
type: string | ||
branch: | ||
description: 'Branch' | ||
required: true | ||
type: choice | ||
default: main | ||
options: | ||
- main | ||
- pre-release | ||
pull_request: | ||
push: | ||
# run only against tags | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
staging: | ||
runs-on: ubuntu-latest | ||
release: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Setup bob | ||
uses: hashicorp/action-setup-bob@v1 | ||
- uses: actions/checkout@v4 | ||
with: | ||
github-token: | ||
${{ secrets.BOB_GITHUB_TOKEN }} | ||
- name: Promote to staging | ||
env: | ||
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version }} | ||
SHA: ${{ github.event.inputs.sha }} | ||
BRANCH: ${{ github.event.inputs.branch }} | ||
ENVIRONMENT: staging | ||
run: | | ||
bob trigger-promotion \ | ||
--product-name=terraform-ls \ | ||
--environment=terraform-ls-oss \ | ||
--org=hashicorp \ | ||
--repo=terraform-ls \ | ||
--slack-channel=C02AGQXCAF5 \ | ||
--product-version=$VERSION \ | ||
--sha=$SHA \ | ||
--branch=$BRANCH \ | ||
$ENVIRONMENT | ||
fetch-depth: 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags) | ||
|
||
production: | ||
runs-on: ubuntu-latest | ||
needs: staging | ||
steps: | ||
- name: Setup bob | ||
uses: hashicorp/action-setup-bob@v1 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: sigstore/[email protected] # installs cosign | ||
|
||
- uses: goreleaser/goreleaser-action@v5 # run goreleaser | ||
with: | ||
github-token: | ||
${{ secrets.BOB_GITHUB_TOKEN }} | ||
- name: Promote to production | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version }} | ||
SHA: ${{ github.event.inputs.sha }} | ||
BRANCH: ${{ github.event.inputs.branch }} | ||
ENVIRONMENT: production | ||
run: | | ||
bob trigger-promotion \ | ||
--product-name=terraform-ls \ | ||
--environment=terraform-ls-oss \ | ||
--org=hashicorp \ | ||
--repo=terraform-ls \ | ||
--slack-channel=C02AGQXCAF5 \ | ||
--product-version=$VERSION \ | ||
--sha=$SHA \ | ||
--branch=$BRANCH \ | ||
$ENVIRONMENT | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
# .goreleaser.yaml | ||
project_name: opentofu-ls | ||
|
||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
- go generate ./... | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
- freebsd | ||
- windows | ||
|
||
archives: | ||
- format: binary | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
# The lines beneath this are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
|
||
package discovery | ||
|
||
const executableName = "terraform" | ||
const executableName = "tofu" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
package discovery | ||
|
||
const executableName = "terraform.exe" | ||
const executableName = "tofu.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.33.0-dev | ||
0.1.0-dev |