Release prod: Build & Publish Artifacts #125
Workflow file for this run
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
name: "Release prod: Build & Publish Artifacts" | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
if: startsWith(github.ref, 'refs/tags/0.0.0-dev') != true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.x | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set env | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
# TODO: This should run only if all tests are satisfying | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
# either 'goreleaser' (default) or 'goreleaser-pro' | |
distribution: goreleaser | |
version: latest | |
args: release -f .goreleaser.yml --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
RELEASE_VERSION: ${{ env.RELEASE_VERSION }} | |
FURY_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }} | |
SHORT_SHA: ${{ env.SHORT_SHA }} | |
- name: create docs | |
run: | | |
mkdir -p commands | |
go run ./cmd gen doc | |
- name: Pushes ize commands to ize.sh | |
uses: dmnemec/copy_file_to_another_repo_action@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
with: | |
source_file: 'website/commands' | |
destination_repo: 'hazelops/ize.sh' | |
destination_folder: 'content' | |
user_email: '[email protected]' | |
user_name: 'ize' | |
commit_message: 'Add commands from Ize' | |
create_jira_release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: create release | |
uses: Rorychan/jira-releases-action@v1 | |
continue-on-error: true | |
with: | |
jira-server: 'https://hazelops.atlassian.net' | |
jira-email: '[email protected]' | |
jira-api-token: ${{ secrets.JIRA_API_TOKEN }} | |
project-name: 'IZE' | |
release-name: ${{ github.event.release.name }} | |
is-released: true | |
- name: Sleep for 7 minutes | |
uses: whatnick/wait-action@master | |
with: | |
time: '7m' |