Release #266
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: | |
workflow_run: | |
workflows: ["Build and test"] | |
branches: [main] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: arnested/go-version-action@v1 | |
id: go-version | |
- name: Bump version and push tag | |
uses: anothrNick/github-tag-action@1.67.0 | |
id: version | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
WITH_V: true | |
DEFAULT_BUMP: patch | |
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
RELEASE_BRANCHES: main | |
- name: Setup Go ${{ steps.go-version.outputs.latest }}.x | |
uses: WillAbides/setup-go-faster@v1.9.0 | |
with: | |
go-version: ${{ steps.go-version.outputs.latest }}.x | |
ignore-local: true | |
- name: go version | |
env: | |
GO111MODULE: 'on' | |
run: go version | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
version: latest | |
args: release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | |
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} | |
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
- name: Import GPG signing key | |
run: | | |
mkdir -p -m 0700 ~/.gnupg/ | |
printf -- "${{ secrets.GPG_SIGNING_KEY }}" > ~/.gnupg/private-key.asc | |
gpg --import --no-tty --batch --yes ~/.gnupg/private-key.asc | |
- name: Copy deb packages into build area | |
run: | | |
mkdir -p site | |
cp -v dist/*.deb site/ | |
- name: Scan packages | |
run: | | |
dpkg-scanpackages --multiversion . > Packages | |
gzip -k -f Packages | |
working-directory: site | |
- name: apt-ftparchive release | |
run: | | |
apt-ftparchive -o APT::FTPArchive::Release::Origin="Arne Jørgensen" -o APT::FTPArchive::Release::Label="${{ steps.go-version.outputs.module }}" release . > Release | |
gpg -abs --no-tty --batch --yes -o - Release > Release.gpg | |
gpg --clearsign --no-tty --batch --yes -o - Release > InRelease | |
working-directory: site | |
- uses: BaileyJM02/markdown-to-pdf@v1.2.0 | |
with: | |
input_path: index.md | |
output_dir: site/ | |
build_html: true | |
build_pdf: false | |
template: page/template.html | |
- name: Fix link / package name in GitHub Pages | |
run: | | |
DEB=$(grep linux_amd64.deb dist/checksums.txt | awk '{print $2}') | |
sed -i "s/ldddns_.*_linux_amd64.deb/<a href=\"https:\/\/github.com\/arnested\/ldddns\/releases\/latest\/download\/${DEB}\">${DEB}<\/a>/" site/index.html | |
- name: Add install script to GitHub Pages | |
run: cp -v install.sh site/install.sh | |
- name: Deploy deb packages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: site | |
clean: true | |
single-commit: true |