release #10
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 | |
on: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
# GITHUB_ENV operates like a .env file | |
- name: extract version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
CLEAN_VERSION=${VERSION#v} | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV | |
- name: node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
# https://news.ycombinator.com/item?id=32388964 | |
# https://github.com/procursusteam/ldid | |
# https://www.pulumi.com/blog/nodejs-binaries-with-pkg/ | |
# https://github.com/pulumi/pulumi-aws-static-website/blob/main/.github/workflows/release.yaml | |
- name: ldid for macos binary building | |
uses: MOZGIII/install-ldid-action@v1 | |
with: | |
tag: v2.1.5-procursus2 | |
- name: npm install | |
run: npm install | |
- name: pkg | |
run: | | |
echo "pkg-ing" | |
./node_modules/.bin/pkg . --no-bytecode --public-packages "*" --public --target node16-macos-x64 --output bin/darwin-amd64/git-dotenv | |
./node_modules/.bin/pkg . --no-bytecode --public-packages "*" --public --target node16-macos-arm64 --output bin/darwin-arm64/git-dotenv | |
./node_modules/.bin/pkg . --no-bytecode --public-packages "*" --public --target node16-linuxstatic-x64 --output bin/linux-amd64/git-dotenv | |
./node_modules/.bin/pkg . --no-bytecode --public-packages "*" --public --target node16-linuxstatic-arm64 --output bin/linux-arm64/git-dotenv | |
./node_modules/.bin/pkg . --no-bytecode --public-packages "*" --public --target node16-win-x64 --output bin/windows-amd64/git-dotenv.exe | |
echo "dist-ing" | |
mkdir -p dist | |
tar --gzip -cf ./dist/git-dotenv-${{ env.CLEAN_VERSION }}-darwin-amd64.tar.gz README.md -C bin/darwin-amd64/ . | |
tar --gzip -cf ./dist/git-dotenv-${{ env.CLEAN_VERSION }}-darwin-arm64.tar.gz README.md -C bin/darwin-arm64/ . | |
tar --gzip -cf ./dist/git-dotenv-${{ env.CLEAN_VERSION }}-linux-amd64.tar.gz README.md -C bin/linux-amd64/ . | |
tar --gzip -cf ./dist/git-dotenv-${{ env.CLEAN_VERSION }}-linux-arm64.tar.gz README.md -C bin/linux-arm64/ . | |
tar --gzip -cf ./dist/git-dotenv-${{ env.CLEAN_VERSION }}-windows-amd64.tar.gz README.md -C bin/windows-amd64/ . | |
- name: create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/*.tar.gz | |
- name: gen checksums | |
uses: wangzuo/action-release-checksums@v1 | |
# https://github.com/Justintime50/homebrew-releaser | |
- name: homebrew releaser | |
uses: Justintime50/homebrew-releaser@v1 | |
with: | |
debug: true | |
homebrew_owner: dotenv-org | |
homebrew_tap: homebrew-brew | |
formula_folder: Formula | |
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
commit_owner: motdotla | |
commit_email: [email protected] | |
install: 'bin.install "git-dotenv"' | |
test: 'system bin/"git-dotenv", "--version"' | |
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes | |
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized): | |
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz' | |
# https://github.com/dotenv-org/git-dotenv/releases/download/v1.2.0/git-dotenv-1.2.0-darwin-amd64.tar.gz | |
target_darwin_amd64: true | |
target_darwin_arm64: true | |
target_linux_amd64: true | |
target_linux_arm64: true | |
strategy: | |
fail-fast: true |