Skip to content

force-release

force-release #2

Workflow file for this run

# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: force-release
on:
workflow_dispatch:
inputs:
sha:
name: sha
type: string
required: true
description: The sha of the commit to release
publish_to_go:
name: publish_to_go
type: boolean
required: true
description: Whether to publish to Go Repository
jobs:
force-release:
runs-on:
- custom
- linux
- custom-linux-medium
permissions:
contents: write
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
ref: ${{ inputs.sha }}
fetch-depth: 0
- name: Set git config safe.directory
run: git config --global --add safe.directory $(pwd)
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 16.14.0
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: build
run: npx projen build
- name: Backup artifact permissions
run: cd dist && getfacl -R . > permissions-backup.acl
continue-on-error: true
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: build-artifact
path: dist
force_release_golang:
name: Publish to Github Go Repository
needs: force-release
runs-on:
- custom
- linux
- custom-linux-medium
permissions:
contents: read
env:
CI: "true"
steps:
- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: 16.14.0
- name: Setup Go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ^1.16.0
- name: Download build artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: build-artifact
path: dist
- name: Restore build artifact permissions
run: cd dist && setfacl --restore=permissions-backup.acl
continue-on-error: true
- name: Prepare Repository
run: mv dist .repo
- name: Install Dependencies
run: cd .repo && yarn install --check-files --frozen-lockfile
- name: Create Artifact
run: cd .repo && npx projen package:go
- name: Setup Copywrite tool
uses: hashicorp/setup-copywrite@867a1a2a064a0626db322392806428f7dc59cb3e
- name: Copy copywrite hcl file
run: cp .repo/.copywrite.hcl .repo/dist/go/.copywrite.hcl
- name: Add headers using Copywrite tool
run: cd .repo/dist/go && copywrite headers
- name: Remove copywrite hcl file
run: rm -f .repo/dist/go/.copywrite.hcl
- name: Collect go Artifact
run: mv .repo/dist dist
- name: Release
if: ${{ inputs.publish_to_go }}
env:
GIT_USER_NAME: CDK for Terraform Team
GIT_USER_EMAIL: github-team-tf-cdk@hashicorp.com
GITHUB_TOKEN: ${{ secrets.GO_GITHUB_TOKEN }}
run: npx -p publib@latest publib-golang